Files
zabbix/docker-compose.yml
2026-02-25 14:54:50 +01:00

79 lines
2.1 KiB
YAML

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_FILE: /run/secrets/mysql-password
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql-root-password
volumes:
- ./mysql_data:/var/lib/mysql
command:
- --character-set-server=utf8
- --collation-server=utf8_bin
- --default-authentication-plugin=mysql_native_password
zabbix-java-gateway:
image: zabbix/zabbix-java-gateway:alpine-7.4-latest
container_name: zabbix-java-gateway
networks:
- zabbix-net
restart: unless-stopped
zabbix-server:
image: zabbix/zabbix-server-mysql
container_name: zabbix-server
secrets:
- mysql-password
- mysql-root-password
networks:
- zabbix-net
restart: unless-stopped
environment:
DB_SERVER_HOST: mysql
MYSQL_DATABASE: zabbix
MYSQL_USER: zabbix
MYSQL_PASSWORD_FILE: /run/secrets/mysql-password
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql-root-password
ZBX_JAVAGATEWAY: zabbix-java-gateway
ports:
- 10051:10051
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
networks:
- zabbix-net
environment:
ZBX_SERVER_HOST: zabbix-server
DB_SERVER_HOST: mysql
MYSQL_DATABASE: zabbix
MYSQL_USER: zabbix
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