added secrets
This commit is contained in:
@@ -2,13 +2,16 @@ services:
|
||||
mysql:
|
||||
image: mysql:8.0-oracle
|
||||
container_name: mysql
|
||||
secrets:
|
||||
- mysql-password
|
||||
- mysql-root-password
|
||||
networks:
|
||||
- zabbix-net
|
||||
environment:
|
||||
MYSQL_DATABASE: zabbix
|
||||
MYSQL_USER: zabbix
|
||||
MYSQL_PASSWORD: /etc/zabbix-passwd/secrets/mysql-password
|
||||
MYSQL_ROOT_PASSWORD: /etc/zabbix-passwd/secrets/mysql-root-password
|
||||
MYSQL_PASSWORD_FILE: /run/secrets/mysql-password
|
||||
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql-root-password
|
||||
volumes:
|
||||
- ./mysql_data:/var/lib/mysql
|
||||
command:
|
||||
@@ -25,16 +28,19 @@ services:
|
||||
|
||||
zabbix-server:
|
||||
image: zabbix/zabbix-server-mysql
|
||||
container-name: zabbix-server
|
||||
container_name: zabbix-server
|
||||
secrets:
|
||||
- mysql-password
|
||||
- mysql-root-password
|
||||
networks:
|
||||
- zabbix-net
|
||||
restart: unless-stopped
|
||||
environnment:
|
||||
environment:
|
||||
DB_SERVER_HOST: mysql
|
||||
MYSQL_DATABASE: zabbix
|
||||
MYSQL_USER: zabbix
|
||||
MYSQL_PASSWORD: /etc/zabbix-passwd/secrets/mysql-password
|
||||
MYSQL_ROOT_PASSWORD: /etc/zabbix-passwd/secrets/mysql-root-password
|
||||
MYSQL_PASSWORD_FILE: /run/secrets/mysql-password
|
||||
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql-root-password
|
||||
ZBX_JAVAGATEWAY: zabbix-java-gateway
|
||||
ports:
|
||||
- 10051:10051
|
||||
@@ -42,24 +48,31 @@ services:
|
||||
zabbix-web-nginx:
|
||||
image: zabbix/zabbix-web-nginx-mysql:alpine-7.4-latest
|
||||
container_name: zabbix-web-nginx
|
||||
secrets:
|
||||
- mysql-password
|
||||
- mysql-root-password
|
||||
restart: unless-stopped
|
||||
newtorks:
|
||||
networks:
|
||||
- zabbix-net
|
||||
environment:
|
||||
ZBX_SERVER_HOST: zabbix-server
|
||||
DB_SERVER_HOST: mysql
|
||||
MYSQL_DATABSE: zabbix
|
||||
MYSQL_DATABASE: zabbix
|
||||
MYSQL_USER: zabbix
|
||||
MYSQL_PASSWORD: /etc/zabbix-passwd/secrets/mysql-password
|
||||
MYSQL_ROOT_PASSWORD: /etc/zabbix-passwd/secrets/mysql-root-password
|
||||
MYSQL_PASSWORD_FILE: /run/secrets/mysql-password
|
||||
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql-root-password
|
||||
ports:
|
||||
- 80:8080
|
||||
|
||||
|
||||
|
||||
networks:
|
||||
zabbix-net:
|
||||
ipam:
|
||||
driver: default
|
||||
config:
|
||||
- subnet: "192.168.1.0/24"
|
||||
|
||||
secrets:
|
||||
mysql-password:
|
||||
file: /etc/zabbix-passwd/secrets/mysql-password
|
||||
mysql-root-password:
|
||||
file: /etc/zabbix-passwd/secrets/mysql-root-password
|
||||
|
||||
Reference in New Issue
Block a user