docker

docker-compose构建zabbix-server

2019-12-31  本文已影响0人  a87a5a0bc344

version: "3"

services:

  zabbix-server:

    image: "zabbix/zabbix-server-mysql"

    container_name: "zabbix-server"

    restart: "always"

    environment:

      - "DB_SERVER_HOST=zabbix-db"

      - "MYSQL_USER=root"

      - "MYSQL_PASSWORD=123456"

     # - "DB_SERVER_PORT="

      #- "MYSQL_DATABASE="

    volumes:

      - "/var/lib/zabbix/"

      - "/etc/zabbix/"

    depends_on:

      - "zabbix-db"

    ports:

      - "10051:10051"

  zabbix-web:

    image: "zabbix/zabbix-web-nginx-mysql"

    container_name: "zabbix-web"

    restart: "always"

    environment:

      - "DB_SERVER_HOST=zabbix-db"

      - "MYSQL_USER=root"

      - "MYSQL_PASSWORD=123456"

      - "ZBX_SERVER_HOST=zabbix-server"

      - "PHP_TZ=Asia/Shanghai  "

      #- "ZBX_SERVER_PORT="

      #- "DB_SERVER_PORT="

      #- "MYSQL_DATABASE="

      #- "ZBX_SERVER_NAME="

    depends_on:

      - "zabbix-server"

      - "zabbix-db"

    ports:

      - "80:80"

  zabbix-db:

    image: "mysql:5.7"

    container_name: "zabbix-db"

    restart: "always"

    environment:

      - "MYSQL_ROOT_PASSWORD=123456"

      - "MYSQL_DATABASE=zabbix"

      - "MYSQL_USER=zabbix"

      - "MYSQL_PASSWORD=123456"

      #- "MYSQL_ALLOW_EMPTY_PASSWORD="

      #- "MYSQL_RANDOM_ROOT_PASSWORD="

    ports:

      - "3306:3306"

    volumes:

      - "/var/lib/mysql/"

      - "/etc/mysql/"

上一篇 下一篇

猜你喜欢

热点阅读