mirror of
https://github.com/Thumbscrew/zabbix-server-docker-compose.git
synced 2025-01-18 09:35:47 +00:00
feat: move postgres to separate compose file (#1)
* move postgres to separate compose file * set default value for external proxy network * bump postgres tag to 14
This commit is contained in:
parent
bbbaec0fcf
commit
9a228ecec5
@ -3,7 +3,8 @@ VOLUME_PATH=/data/zabbix
|
|||||||
DOCKER_PROXY_NETWORK=proxy
|
DOCKER_PROXY_NETWORK=proxy
|
||||||
|
|
||||||
# PostgreSQL
|
# PostgreSQL
|
||||||
POSTGRES_TAG=13
|
POSTGRES_TAG=14
|
||||||
|
POSTGRES_HOST=db
|
||||||
|
|
||||||
# Zabbix
|
# Zabbix
|
||||||
ZABBIX_TAG=5.4-alpine-latest
|
ZABBIX_TAG=5.4-alpine-latest
|
||||||
|
33
docker-compose.db.yaml
Normal file
33
docker-compose.db.yaml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
networks:
|
||||||
|
database:
|
||||||
|
|
||||||
|
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:
|
||||||
|
networks:
|
||||||
|
- database
|
||||||
|
environment:
|
||||||
|
DB_SERVER_HOST: postgres-server
|
||||||
|
depends_on:
|
||||||
|
- postgres-server
|
||||||
|
zabbix-web: # The main Zabbix web UI or interface
|
||||||
|
networks:
|
||||||
|
- database
|
||||||
|
environment: # Postgres database variables
|
||||||
|
DB_SERVER_HOST: postgres-server
|
||||||
|
depends_on:
|
||||||
|
- postgres-server
|
@ -7,35 +7,17 @@ secrets:
|
|||||||
file: ./secrets/postgres_password.txt
|
file: ./secrets/postgres_password.txt
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
database:
|
|
||||||
web:
|
web:
|
||||||
agent:
|
agent:
|
||||||
proxy:
|
proxy:
|
||||||
external: true
|
external: ${DOCKER_PROXY_EXT-false}
|
||||||
name: ${DOCKER_PROXY_NETWORK}
|
name: ${DOCKER_PROXY_NETWORK}
|
||||||
|
|
||||||
services:
|
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:
|
zabbix-server:
|
||||||
image: zabbix/zabbix-server-pgsql:${ZABBIX_TAG}
|
image: zabbix/zabbix-server-pgsql:${ZABBIX_TAG}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- database
|
|
||||||
- web
|
- web
|
||||||
- agent
|
- agent
|
||||||
secrets:
|
secrets:
|
||||||
@ -43,6 +25,8 @@ services:
|
|||||||
- postgres_user
|
- postgres_user
|
||||||
- postgres_password
|
- postgres_password
|
||||||
environment:
|
environment:
|
||||||
|
DB_SERVER_HOST: ${POSTGRES_HOST}
|
||||||
|
DB_SERVER_PORT: ${POSTGRES_PORT-5432}
|
||||||
POSTGRES_DB_FILE: /run/secrets/postgres_db
|
POSTGRES_DB_FILE: /run/secrets/postgres_db
|
||||||
POSTGRES_USER_FILE: /run/secrets/postgres_user
|
POSTGRES_USER_FILE: /run/secrets/postgres_user
|
||||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||||
@ -56,8 +40,6 @@ services:
|
|||||||
ZBX_STARTPOLLERSUNREACHABLE: 10
|
ZBX_STARTPOLLERSUNREACHABLE: 10
|
||||||
ports:
|
ports:
|
||||||
- 10051:10051
|
- 10051:10051
|
||||||
depends_on:
|
|
||||||
- postgres-server
|
|
||||||
volumes:
|
volumes:
|
||||||
- ${VOLUME_PATH}/usr/lib/zabbix/alertscripts:/usr/lib/zabbix/alertscripts:rw
|
- ${VOLUME_PATH}/usr/lib/zabbix/alertscripts:/usr/lib/zabbix/alertscripts:rw
|
||||||
|
|
||||||
@ -66,13 +48,14 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
- database
|
|
||||||
- web
|
- web
|
||||||
secrets:
|
secrets:
|
||||||
- postgres_db
|
- postgres_db
|
||||||
- postgres_user
|
- postgres_user
|
||||||
- postgres_password
|
- postgres_password
|
||||||
environment: # Postgres database variables
|
environment: # Postgres database variables
|
||||||
|
DB_SERVER_HOST: ${POSTGRES_HOST}
|
||||||
|
DB_SERVER_PORT: ${POSTGRES_PORT-5432}
|
||||||
POSTGRES_DB_FILE: /run/secrets/postgres_db
|
POSTGRES_DB_FILE: /run/secrets/postgres_db
|
||||||
POSTGRES_USER_FILE: /run/secrets/postgres_user
|
POSTGRES_USER_FILE: /run/secrets/postgres_user
|
||||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||||
@ -81,7 +64,6 @@ services:
|
|||||||
PHP_TZ: ${ZABBIX_TZ}
|
PHP_TZ: ${ZABBIX_TZ}
|
||||||
ZBX_MAXEXECUTIONTIME: 500
|
ZBX_MAXEXECUTIONTIME: 500
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres-server
|
|
||||||
- zabbix-server
|
- zabbix-server
|
||||||
# ports: # Port where Zabbix UI is available
|
# ports: # Port where Zabbix UI is available
|
||||||
# - 80:8080
|
# - 80:8080
|
||||||
|
Loading…
Reference in New Issue
Block a user