Update db name and add watch tower

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
Bensuperpc 2024-05-05 18:28:37 +02:00
parent fe7cac2fb5
commit 5e3b93ac20
No known key found for this signature in database
GPG Key ID: 15D0B1525584D383
6 changed files with 43 additions and 27 deletions

View File

@ -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 /')

View File

@ -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.

View File

@ -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

View File

@ -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

2
env/adminer.env vendored
View File

@ -1,4 +1,4 @@
MYSQL_ROOT_PASSWORD=7L1Ncbquax0B2TCOmrjaQl9n5mnY88bQ
MYSQL_USER=bensuperpc
MYSQL_PASSWORD=lEOEf8cndnDjp84O4Uv5D9zJLJDFatLw
ADMINER_DEFAULT_SERVER=database
ADMINER_DEFAULT_SERVER=wordpress_db

2
env/wordpress.env vendored
View File

@ -1,4 +1,4 @@
WORDPRESS_DB_USER=bensuperpc
WORDPRESS_DB_PASSWORD=lEOEf8cndnDjp84O4Uv5D9zJLJDFatLw
WORDPRESS_DB_NAME=wordpress
WORDPRESS_DB_HOST=database:3306
WORDPRESS_DB_HOST=wordpress_db:3306