Removed MySQL root secret for server and proxy containers

This commit is contained in:
Alexey Pustovalov 2024-01-19 01:13:10 +09:00
parent bf8b26a5d8
commit 1d8a654840
5 changed files with 7 additions and 6 deletions

View File

@ -7,6 +7,7 @@ services:
- --character-set-server=utf8
- --collation-server=utf8_bin
- --default-authentication-plugin=mysql_native_password
# Use TLS encryption for connections to database
# - --require-secure-transport
# - --ssl-ca=/run/secrets/root-ca.pem
# - --ssl-cert=/run/secrets/server-cert.pem
@ -14,9 +15,12 @@ services:
restart: "${RESTART_POLICY}"
volumes:
- ${DATA_DIRECTORY}/var/lib/mysql:/var/lib/mysql:rw
- ${ENV_VARS_DIRECTORY}/mysql_init/init_proxy_db.sql:/docker-entrypoint-initdb.d/mysql_init_proxy.sql:ro
# - dbsocket:/var/run/mysqld/
env_file:
- ${ENV_VARS_DIRECTORY}/.env_db_mysql
environment:
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/MYSQL_ROOT_PASSWORD
secrets:
- MYSQL_USER
- MYSQL_PASSWORD

View File

@ -65,8 +65,6 @@ services:
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_USER
- MYSQL_ROOT_PASSWORD
# - client-key.pem
# - client-cert.pem
# - root-ca.pem
@ -171,8 +169,6 @@ services:
secrets:
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_ROOT_USER
- MYSQL_ROOT_PASSWORD
# - client-key.pem
# - client-cert.pem
# - root-ca.pem

View File

@ -6,7 +6,7 @@ MYSQL_USER_FILE=/run/secrets/MYSQL_USER
# MYSQL_PASSWORD=zabbix
MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD
# MYSQL_ROOT_PASSWORD=
MYSQL_ROOT_PASSWORD_FILE=/run/secrets/MYSQL_ROOT_PASSWORD
# MYSQL_ROOT_PASSWORD_FILE=/run/secrets/MYSQL_ROOT_PASSWORD
# MYSQL_ALLOW_EMPTY_PASSWORD=false
# MYSQL_DATABASE=zabbix
MYSQL_DATABASE=zabbix

View File

@ -8,7 +8,6 @@ MYSQL_USER=zabbix
MYSQL_PASSWORD=zabbix
# MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD
# MYSQL_ROOT_PASSWORD=
MYSQL_ROOT_PASSWORD=root_pwd
# MYSQL_ROOT_PASSWORD_FILE=/run/secrets/MYSQL_ROOT_PASSWORD
# MYSQL_ALLOW_EMPTY_PASSWORD=false
# MYSQL_DATABASE=zabbix_proxy

View File

@ -0,0 +1,2 @@
CREATE DATABASE IF NOT EXISTS `zabbix_proxy`;
GRANT ALL ON `zabbix_proxy`.* TO 'zabbix'@'%';