docker(21):docker-compose构建zabbix
docker(21):docker-compose构建zabbix
https://www.zabbix.com/documentation/3.4/zh/manual/installation/containers
https://www.soulchild.cn/651.html
1 docker-compose.yml
version: '3' services: mysql-server: image: mysql:5.7 restart: always environment: MYSQL_ROOT_PASSWORD: root_pwd MYSQL_DATABASE: zabbix MYSQL_USER: zabbix MYSQL_PASSWORD: zabbix_pwd command: --character-set-server=utf8 zabbix-java-gateway: image: zabbix/zabbix-java-gateway:latest restart: always zabbix-server: depends_on: - mysql-server image: zabbix/zabbix-server-mysql:latest restart: always environment: DB_SERVER_HOST: mysql-server MYSQL_DATABASE: zabbix MYSQL_USER: zabbix MYSQL_PASSWORD: zabbix_pwd MYSQL_ROOT_PASSWORD: root_pwd ZBX_JAVAGATEWAY: zabbix-java-gateway ports: - "10051:10051" zabbix-web-nginx-mysql: depends_on: - zabbix-server image: zabbix/zabbix-web-nginx-mysql:latest ports: - "80:80" restart: always environment: DB_SERVER_HOST: mysql-server MYSQL_DATABASE: zabbix MYSQL_USER: zabbix MYSQL_PASSWORD: zabbix_pwd MYSQL_ROOT_PASSWORD: root_pwd
2 运行
[root@docker-136 zabbix]# docker-compose up -d Starting zabbix_mysql-server_1 ... done Starting zabbix_zabbix-java-gateway_1 ... done Starting zabbix_zabbix-server_1 ... done Starting zabbix_zabbix-web-nginx-mysql_1 ... done [root@docker-136 zabbix]#
3 测试