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

zabbix-docker安装

时间:2020-08-04 16:41:43      阅读:76      评论:0      收藏:0      [点我收藏+]

标签:local   depends   restart   services   sha   art   rest   depend   pos   

创建目录/data/zabbix

新建docker-compose.yml文件,执行docker-compose up -d

 

version: ‘3‘
services:

  zabbix_mysql:
    container_name: "zabbix_mysql"
    restart: "always"
    image: mariadb
    ports:
      - "3306:3306"
    volumes:
      - /data/docker/mysql-data:/var/lib/mysql
      - /etc/localtime:/etc/localtime
    environment:
      MYSQL_ROOT_PASSWORD: "mysqlpss123"
      MYSQL_USER: "zabbix"
      MYSQL_PASSWORD: "mysqlpss123"
      MYSQL_DATABASE: "zabbix"

  zabbix_server:
    container_name: "zabbix_server"
    restart: "always"
    image: zabbix/zabbix-server-mysql
    ports:
      - "10051:10051"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /data/docker/zabbix:/usr/lib/zabbix
      - /etc/localtime:/etc/localtime
    depends_on:
      - zabbix_mysql
    links:
      - zabbix_mysql:mysql
    environment:
      DB_SERVER_HOST: "mysql"
      MYSQL_USER: "zabbix"
      MYSQL_DATABASE: "zabbix"
      MYSQL_PASSWORD: "mysqlpss123"

  zabbix_nginx_web:
    container_name: "zabbix_nginx_web"
    restart: "always"
    image: zabbix/zabbix-web-nginx-mysql
    ports:
      - "8443:443"
      - "10000:8080"
    volumes:
      - /etc/localtime:/etc/localtime
    depends_on:
      - zabbix_mysql
      - zabbix_server
    links:
      - zabbix_mysql:mysql
      - zabbix_server:zabbix_server
    environment:
      DB_SERVER_HOST: "mysql"
      MYSQL_USER: "zabbix"
      MYSQL_PASSWORD: "mysqlpss123"
      MYSQL_DATABASE: "zabbix"
      ZBX_SERVER_HOST: "zabbix_server"
      PHP_TZ: "Asia/Shanghai"
  zabbix-agent-a:
    image: zabbix/zabbix-agent
    links:
      - zabbix_server:zabbix_server
    container_name: zabbix-agent-a
    restart: always
    volumes:
      - /etc/localtime:/etc/localtime
    depends_on:
      - zabbix_server
    environment:
      - ZBX_HOSTNAME=zabbix-agent-a  
      - ZBX_SERVER_HOST=zabbix_server

 

zabbix-docker安装

标签:local   depends   restart   services   sha   art   rest   depend   pos   

原文地址:https://www.cnblogs.com/lazy-sang/p/13433474.html

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