标签:docker root scripts environ depend etc comm code word
version: ‘3‘
services:
zabbix-mysql:
image: mysql:5.7
hostname: zabbix-mysql
restart: always
networks:
- zabbix-net
ports:
- "3306:3306"
command: --character-set-server=utf8 --collation-server=utf8_bin
volumes:
- /etc/localtime:/etc/localtime
environment:
MYSQL_DATABASE: zabbix
MYSQL_USER: zabbix
MYSQL_PASSWORD: zabbix
MYSQL_ROOT_PASSWORD: shinibaba
zabbix-java-gateway:
hostname: zabbix-java-gateway
image: zabbix/zabbix-java-gateway:latest
restart: always
networks:
- zabbix-net
volumes:
- /etc/localtime:/etc/localtime
zabbix-server:
depends_on:
- zabbix-mysql
hostname: zabbix-server
restart: always
image: zabbix/zabbix-server-mysql:latest
ports:
- "10051:10051"
volumes:
- /etc/localtime:/etc/localtime
- /usr/lib/zabbix/alertscripts:/usr/lib/zabbix/alertscripts
networks:
- zabbix-net
environment:
DB_SERVER_HOST: zabbix-mysql
MYSQL_DATABASE: zabbix
MYSQL_USER: zabbix
MYSQL_PASSWORD: zabbix
MYSQL_ROOT_PASSWORD: shinibaba
ZBX_JAVAGATEWAY: zabbix-java-gateway
zabbix-nginx:
depends_on:
- zabbix-server
hostname: zabbix-nginx
restart: always
image: zabbix/zabbix-web-nginx-mysql:latest
ports:
- "80:8080"
networks:
- zabbix-net
volumes:
- /etc/localtime:/etc/localtime
environment:
DB_SERVER_HOST: zabbix-mysql
MYSQL_DATABASE: zabbix
MYSQL_USER: zabbix
MYSQL_PASSWORD: zabbix
MYSQL_ROOT_PASSWORD: shinibaba
ZBX_SERVER_HOST: zabbix-server-mysql
networks:
zabbix-net:
docker-compose启动后,需要把zabbix-server容器/etc/hosts文件中,127.0.0.1后面添加zabbix-server
标签:docker root scripts environ depend etc comm code word
原文地址:https://www.cnblogs.com/ly447742/p/14456910.html