本文共 1352 字,大约阅读时间需要 4 分钟。
version: '2'services: zabbix-mysql: image: mysql:5.7 container_name: zabbix-mysql volumes: - "/data/mysql:/var/lib/mysql" - "/usr/share/zoneinfo/Asia/Shanghai:/etc/localtime" restart: always ports: - "3306:3306" environment: MYSQL_ROOT_PASSWORD: zabbix MYSQL_DATABASE: zabbix MYSQL_USER: zabbix MYSQL_PASSWORD: zabbix command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci zabbix-server: image: zabbix/zabbix-server-mysql:ubuntu-3.4.11 container_name: zabbix-server-mysql restart: always ports: - "10051:10051" volumes: - /etc/localtime:/etc/localtime:ro environment: - DB_SERVER_HOST=mysql - MYSQL_USER=zabbix - MYSQL_DATABASE=zabbix - MYSQL_PASSWORD=zabbix links: - zabbix-mysql:mysql zabbix-server: image: zabbix/zabbix-web-nginx-mysql:ubuntu-3.4.11 container_name: zabbix-web-nginx-mysql restart: always ports: - "8088:80" volumes: - /etc/localtime:/etc/localtime:ro environment: - DB_SERVER_HOST=mysql - MYSQL_USER=zabbix - MYSQL_DATABASE=zabbix - MYSQL_PASSWORD=zabbix TZ: "Europe/Budapest" links: - zabbix-mysql:mysql - zabbix-server:zabbix-server
启动命令参考
docker-compose up -ddocker-compose down -v
转载于:https://blog.51cto.com/bkmaster/2333562