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 7fbca79b47
commit 3292d0df09
5 changed files with 8 additions and 8 deletions

View File

@ -6,8 +6,8 @@ services:
- mysqld
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_bin
# Only during upgrade from versions prior 6.4
# - --log_bin_trust_function_creators=1
# Only during upgrade from versions prior 6.4 and new installations (schema deployment)
- --log_bin_trust_function_creators=1
# Use TLS encryption for connections to database
# - --require-secure-transport
# - --ssl-ca=/run/secrets/root-ca.pem
@ -16,9 +16,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'@'%';