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 -d
docker-compose down -v

或扫描关注二维码,关注更多动态
快速启动zabbix监控服务集群_第1张图片