diff --git a/Makefile b/Makefile index 848bed5..2e00de5 100644 --- a/Makefile +++ b/Makefile @@ -12,5 +12,5 @@ down: clean: down sudo docker network rm wordpress - sudo docker system prune - rm -rf ./data ./build + yes | sudo docker system prune -a + rm -rf ~/data ./build diff --git a/srcs/docker-compose.yml b/srcs/docker-compose.yml index f0796a8..e373174 100644 --- a/srcs/docker-compose.yml +++ b/srcs/docker-compose.yml @@ -6,23 +6,39 @@ services: container_name: nginx restart: always volumes: - - /data/nginx/config:/etc/nginx - - /data/nginx/log/error.log:/var/log/error.log - - /data/nginx/log/access.log:/var/log/access.log + - ~/data/nginx/config:/etc/nginx + - ~/data/nginx/log/error.log:/var/log/error.log + - ~/data/nginx/log/access.log:/var/log/access.log - /etc/letsencrypt/:/etc/letsencrypt/ - /etc/localtime:/etc/localtime:ro ports: - 80:80 - 443:443 + networks: + wordpress: + ipv4_address: 172.20.30.10 mariadb: build: ./srcs/requirements/mariadb container_name: mariadb restart: always volumes: - - /data/mariadb/data:/var/lib/mysql - - /data/mariadb/config:/etc/mysql/conf.d - - /data/mariadb/logs:/var/log/mysql + - ~/data/mariadb/data:/var/lib/mysql + - ~/data/mariadb/config:/etc/mysql/conf.d + - ~/data/mariadb/logs:/var/log/mysql - /etc/localtime:/etc/localtime:ro + networks: + wordpress: + ipv4_address: 172.20.30.20 + wordpress: + build: ./srcs/requirements/wordpress + container_name: wordpress + restart: always + volumes: + - ~/data/wordpress:/var/www + - /etc/localtime:/etc/localtime:ro + networks: + wordpress: + ipv4_address: 172.20.30.30 networks: wordpress: diff --git a/srcs/requirements/mariadb/Dockerfile b/srcs/requirements/mariadb/Dockerfile index fd68be6..34062f5 100644 --- a/srcs/requirements/mariadb/Dockerfile +++ b/srcs/requirements/mariadb/Dockerfile @@ -5,7 +5,6 @@ RUN apk add mariadb RUN apk add mariadb-client RUN apk add telegraf COPY srcs/start.sh /root/start.sh -COPY srcs/telegraf.conf /etc/telegraf/telegraf.conf COPY srcs/my.cnf /etc/my.cnf.d/mariadb-server.cnf COPY srcs/maria.sql /root/maria.sql WORKDIR /root/ diff --git a/srcs/requirements/nginx/Dockerfile b/srcs/requirements/nginx/Dockerfile index 03f15fc..cd7b10b 100644 --- a/srcs/requirements/nginx/Dockerfile +++ b/srcs/requirements/nginx/Dockerfile @@ -8,7 +8,6 @@ RUN apk add telegraf COPY srcs/start.sh /root/start.sh COPY srcs/nginx.conf /etc/nginx/nginx.conf COPY srcs/index.html /var/www/index.html -COPY srcs/telegraf.conf /etc/telegraf/telegraf.conf WORKDIR /root/ RUN adduser --disabled-password admin RUN echo "admin:password" | chpasswd diff --git a/srcs/requirements/wordpress/Dockerfile b/srcs/requirements/wordpress/Dockerfile index 30d0bbc..b7ee671 100644 --- a/srcs/requirements/wordpress/Dockerfile +++ b/srcs/requirements/wordpress/Dockerfile @@ -2,20 +2,17 @@ FROM alpine RUN sleep 10 RUN apk update RUN apk add openssl -RUN apk add nginx -RUN apk add php7 -RUN apk add php7-fpm -RUN apk add php7-mysqli -RUN apk add php7-gd -RUN apk add php7-mbstring -RUN apk add php7-curl -RUN apk add php7-json -RUN apk add php7-xml -RUN apk add php7-zip -RUN apk add telegraf +RUN apk add php +RUN apk add php-fpm +RUN apk add php-mysqli +RUN apk add php-gd +RUN apk add php-mbstring +RUN apk add php-curl +RUN apk add php-json +RUN apk add php-xml +RUN apk add php-zip COPY srcs/start.sh /root/start.sh COPY srcs/nginx.conf /etc/nginx/nginx.conf -COPY srcs/telegraf.conf /etc/telegraf/telegraf.conf COPY srcs/wordpress.conf /var/www/wordpress/wp-config.php WORKDIR /root/ RUN wget https://wordpress.org/latest.tar.gz