Use secrets for database service

This commit is contained in:
Aleksandar Puharic 2024-05-24 01:33:39 +02:00
parent bcf6214c3d
commit f228e0554b
Signed by: xZero707
GPG Key ID: 3CC53DCAA9C237BB

View File

@ -25,6 +25,10 @@ x-wordpress-configuration-env: &wordpress-configuration-env
networks:
default:
secrets:
database_root_password:
file: ./.secrets/database_root_password.txt
services:
wordpress:
image: ghcr.io/n0rthernl1ghts/wordpress:6.5.3
@ -106,10 +110,12 @@ services:
MARIADB_INIT_DATABASES: wordpress
MARIADB_INIT_USERS: wordpress
MARIADB_PASSWORD: wordpress # CHANGE THIS!
MARIADB_ROOT_PASSWORD: 'super-secure-root-password123' # CHANGE THIS!
FILE__MARIADB_ROOT_PASSWORD: /run/secrets/database_root_password
FORCE_CONFIG_OVERWRITE: 1
volumes:
- ./data/database/config:/config
- ./data/database/data:/var/lib/mysql
secrets:
- database_root_password
networks:
default: