码迷,mamicode.com
首页 > 其他好文 > 详细

docker-compose安装zabbix

时间:2021-03-01 13:11:33      阅读:0      评论:0      收藏:0      [点我收藏+]

标签: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-compose安装zabbix

标签:docker   root   scripts   environ   depend   etc   comm   code   word   

原文地址:https://www.cnblogs.com/ly447742/p/14456910.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!