mirror of
https://github.com/Thumbscrew/zabbix-server-docker-compose.git
synced 2025-04-12 10:13:41 +00:00
79 lines
2.2 KiB
YAML
79 lines
2.2 KiB
YAML
secrets:
|
|
postgres_db:
|
|
file: ./secrets/postgres_db.txt
|
|
postgres_user:
|
|
file: ./secrets/postgres_user.txt
|
|
postgres_password:
|
|
file: ./secrets/postgres_password.txt
|
|
|
|
networks:
|
|
web:
|
|
agent:
|
|
proxy:
|
|
external: ${DOCKER_PROXY_EXT-false}
|
|
name: ${DOCKER_PROXY_NETWORK}
|
|
|
|
services:
|
|
zabbix-server:
|
|
image: zabbix/zabbix-server-pgsql:${ZABBIX_TAG}
|
|
restart: unless-stopped
|
|
networks:
|
|
- web
|
|
- agent
|
|
secrets:
|
|
- postgres_db
|
|
- postgres_user
|
|
- postgres_password
|
|
environment:
|
|
DB_SERVER_HOST: ${POSTGRES_HOST}
|
|
DB_SERVER_PORT: ${POSTGRES_PORT-5432}
|
|
POSTGRES_DB_FILE: /run/secrets/postgres_db
|
|
POSTGRES_USER_FILE: /run/secrets/postgres_user
|
|
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
|
ZBX_HISTORYSTORAGETYPES: log,text # Zabbix configuration variables
|
|
ZBX_DEBUGLEVEL: 1
|
|
ZBX_HOUSEKEEPINGFREQUENCY: 1
|
|
ZBX_MAXHOUSEKEEPERDELETE: 5000
|
|
ZBX_STARTPINGERS: 5
|
|
ZBX_STARTDISCOVERERS: 5
|
|
ZBX_TIMEOUT: 5
|
|
ZBX_STARTPOLLERSUNREACHABLE: 10
|
|
ports:
|
|
- 10051:10051
|
|
volumes:
|
|
- ${VOLUME_PATH}/usr/lib/zabbix/alertscripts:/usr/lib/zabbix/alertscripts:rw
|
|
|
|
zabbix-web: # The main Zabbix web UI or interface
|
|
image: zabbix/zabbix-web-nginx-pgsql:${ZABBIX_TAG}
|
|
restart: unless-stopped
|
|
networks:
|
|
- proxy
|
|
- web
|
|
secrets:
|
|
- postgres_db
|
|
- postgres_user
|
|
- postgres_password
|
|
environment: # Postgres database variables
|
|
DB_SERVER_HOST: ${POSTGRES_HOST}
|
|
DB_SERVER_PORT: ${POSTGRES_PORT-5432}
|
|
POSTGRES_DB_FILE: /run/secrets/postgres_db
|
|
POSTGRES_USER_FILE: /run/secrets/postgres_user
|
|
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
|
ZBX_SERVER_HOST: zabbix-server # Zabbix related and PHP variables
|
|
ZBX_POSTMAXSIZE: 64M
|
|
PHP_TZ: ${ZABBIX_TZ}
|
|
ZBX_MAXEXECUTIONTIME: 500
|
|
depends_on:
|
|
- zabbix-server
|
|
# ports: # Port where Zabbix UI is available
|
|
# - 80:8080
|
|
|
|
zabbix-agent: # Zabbix agent service that tracks usage and send to zabbix server
|
|
image: zabbix/zabbix-agent2:${ZABBIX_TAG}
|
|
restart: unless-stopped
|
|
networks:
|
|
- agent
|
|
# network_mode: "host"
|
|
privileged: true
|
|
depends_on:
|
|
- zabbix-server |