mirror of
https://github.com/Thumbscrew/zabbix-server-docker-compose.git
synced 2025-01-18 09:35:47 +00:00
add initial docker-compose.yaml
This commit is contained in:
parent
b3ba7bf3a3
commit
5211530f55
9
.env.example
Normal file
9
.env.example
Normal file
@ -0,0 +1,9 @@
|
||||
# Docker
|
||||
VOLUME_PATH=/data/zabbix
|
||||
|
||||
# PostgreSQL
|
||||
POSTGRES_TAG=13
|
||||
|
||||
# Zabbix
|
||||
ZABBIX_TAG=5.4-alpine-latest
|
||||
ZABBIX_TZ="Europe/London"
|
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
.env
|
||||
|
||||
secrets/postgres_password.txt
|
89
docker-compose.yaml
Normal file
89
docker-compose.yaml
Normal file
@ -0,0 +1,89 @@
|
||||
secrets:
|
||||
postgres_db:
|
||||
file: ./secrets/postgres_db.txt
|
||||
postgres_user:
|
||||
file: ./secrets/postgres_user.txt
|
||||
postgres_password:
|
||||
file: ./secrets/postgres_password.txt
|
||||
|
||||
networks:
|
||||
database:
|
||||
web:
|
||||
agent:
|
||||
|
||||
services:
|
||||
postgres-server:
|
||||
image: postgres:${POSTGRES_TAG}
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ${VOLUME_PATH}/var/lib/postgresql/data:/var/lib/postgresql/data:rw
|
||||
networks:
|
||||
- database
|
||||
secrets:
|
||||
- postgres_db
|
||||
- postgres_user
|
||||
- postgres_password
|
||||
environment:
|
||||
POSTGRES_DB_FILE: /run/secrets/postgres_db
|
||||
POSTGRES_USER_FILE: /run/secrets/postgres_user
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||
|
||||
zabbix-server:
|
||||
image: zabbix/zabbix-server-pgsql:${ZABBIX_TAG}
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- database
|
||||
- web
|
||||
- agent
|
||||
secrets:
|
||||
- postgres_db
|
||||
- postgres_user
|
||||
- postgres_password
|
||||
environment:
|
||||
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
|
||||
ports:
|
||||
- 10051:10051
|
||||
depends_on:
|
||||
- postgres-server
|
||||
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:
|
||||
- database
|
||||
- web
|
||||
secrets:
|
||||
- postgres_db
|
||||
- postgres_user
|
||||
- postgres_password
|
||||
environment: # Postgres database variables
|
||||
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:
|
||||
- postgres-server
|
||||
- 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-agent:${ZABBIX_TAG}
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- agent
|
||||
# network_mode: "host"
|
||||
privileged: true
|
||||
depends_on:
|
||||
- zabbix-server
|
1
secrets/postgres_db.txt
Normal file
1
secrets/postgres_db.txt
Normal file
@ -0,0 +1 @@
|
||||
zabbix
|
1
secrets/postgres_user.txt
Normal file
1
secrets/postgres_user.txt
Normal file
@ -0,0 +1 @@
|
||||
zabbix
|
Loading…
Reference in New Issue
Block a user