以docker-compose方式安装zabbix
- 建立目录mkdir docker-zabbix
建立文件 vim docker-compose.yml
version: '3.5' services: mysql-server-for-zabbix: image: mysql:5.7 volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro environment: - MYSQL_DATABASE=zabbix - MYSQL_USER=zabbix - MYSQL_PASSWORD=zabbix_pwd - MYSQL_ROOT_PASSWORD=123 zabbix-server: image: zabbix/zabbix-server-mysql environment: - DB_SERVER_HOST=mysql-server-for-zabbix - MYSQL_DATABASE=zabbix - MYSQL_USER=zabbix - MYSQL_PASSWORD=zabbix_pwd - MYSQL_ROOT_PASSWORD=123 ports: - 10051:10051 volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro zabbix-web: image: zabbix/zabbix-web-nginx-mysql environment: - DB_SERVER_HOST=mysql-server-for-zabbix - MYSQL_DATABASE=zabbix - MYSQL_USER=zabbix - MYSQL_PASSWORD=zabbix_pwd - MYSQL_ROOT_PASSWORD=123 - PHP_TZ="Asia/Shanghai" ports: - 82:8080 volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro
- 运行docker-compose up -d