diff --git a/Makefile b/Makefile index b232a2e..25fd60d 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ DOCKER := docker -PROFILES := webserver database wordpress adminer uptime-kuma portainer qbittorrent gitea jellyfin +PROFILES := webserver wordpress adminer uptime-kuma portainer qbittorrent gitea jellyfin watchtower PROFILE_CMD := $(addprefix --profile ,$(PROFILES)) COMPOSE_FILES := $(shell find docker-compose*.yml | sed -e 's/^/--file /') diff --git a/README.md b/README.md index 1300766..a7a676b 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ For the [wordpress.env](env/wordpress.env) file, you need to change the password WORDPRESS_DB_USER=bensuperpc WORDPRESS_DB_PASSWORD=lEOEf8cndnDjp84O4Uv5D9zJLJDFatLw WORDPRESS_DB_NAME=wordpress -WORDPRESS_DB_HOST=database:3306 +WORDPRESS_DB_HOST=wordpress_db:3306 ``` For [wordpress_db.env](env/wordpress_db.env) file, you need to change the password(s) and user for the database. @@ -109,7 +109,7 @@ For [adminer.env](env/adminer.env) file, you need to change the password(s) and MYSQL_ROOT_PASSWORD=7L1Ncbquax0B2TCOmrjaQl9n5mnY88bQ MYSQL_USER=bensuperpc MYSQL_PASSWORD=lEOEf8cndnDjp84O4Uv5D9zJLJDFatLw -ADMINER_DEFAULT_SERVER=database +ADMINER_DEFAULT_SERVER=wordpress_db ``` For [gitea.env](env/gitea.env) file, you need to change the password(s) and user for the database. diff --git a/docker-compose.watchtower.yml b/docker-compose.watchtower.yml new file mode 100644 index 0000000..16303d6 --- /dev/null +++ b/docker-compose.watchtower.yml @@ -0,0 +1,16 @@ +version: '3.9' + +services: + # Watchtower + watchtower: + image: containrrr/watchtower + container_name: watchtower + profiles: + - watchtower + restart: on-failure + networks: + - infra-network + volumes: + - /var/run/docker.sock:/var/run/docker.sock:rw + security_opt: + - no-new-privileges:true diff --git a/docker-compose.wordpress.yml b/docker-compose.wordpress.yml index 1b8cb69..da5c826 100644 --- a/docker-compose.wordpress.yml +++ b/docker-compose.wordpress.yml @@ -1,26 +1,6 @@ version: '3.9' services: - # Database wordpress - database: - image: mariadb:latest - container_name: database - profiles: - - database - - wordpress - depends_on: - - caddy - restart: on-failure - volumes: - - database:/var/lib/mysql:rw - env_file: - - env/wordpress_db.env - command: '--default-authentication-plugin=mysql_native_password' - networks: - - infra-network - security_opt: - - no-new-privileges:true - # Wordpress wordpress: image: wordpress:fpm @@ -29,7 +9,7 @@ services: - wordpress restart: on-failure depends_on: - - database + - wordpress_db - caddy env_file: - env/wordpress.env @@ -51,9 +31,29 @@ services: env_file: - env/adminer.env depends_on: - - database + - wordpress_db - caddy networks: - infra-network security_opt: - no-new-privileges:true + + # Database wordpress + wordpress_db: + image: mariadb:latest + container_name: wordpress_db + profiles: + - database + - wordpress + depends_on: + - caddy + restart: on-failure + volumes: + - database:/var/lib/mysql:rw + env_file: + - env/wordpress_db.env + command: '--default-authentication-plugin=mysql_native_password' + networks: + - infra-network + security_opt: + - no-new-privileges:true diff --git a/env/adminer.env b/env/adminer.env index 02fbca5..61f9606 100644 --- a/env/adminer.env +++ b/env/adminer.env @@ -1,4 +1,4 @@ MYSQL_ROOT_PASSWORD=7L1Ncbquax0B2TCOmrjaQl9n5mnY88bQ MYSQL_USER=bensuperpc MYSQL_PASSWORD=lEOEf8cndnDjp84O4Uv5D9zJLJDFatLw -ADMINER_DEFAULT_SERVER=database +ADMINER_DEFAULT_SERVER=wordpress_db diff --git a/env/wordpress.env b/env/wordpress.env index 7f8a95e..4c0d95a 100644 --- a/env/wordpress.env +++ b/env/wordpress.env @@ -1,4 +1,4 @@ WORDPRESS_DB_USER=bensuperpc WORDPRESS_DB_PASSWORD=lEOEf8cndnDjp84O4Uv5D9zJLJDFatLw WORDPRESS_DB_NAME=wordpress -WORDPRESS_DB_HOST=database:3306 \ No newline at end of file +WORDPRESS_DB_HOST=wordpress_db:3306 \ No newline at end of file