docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 zabbix-net
docker run --name postgres-server -t \
-e POSTGRES_USER="zabbix" \
-e POSTGRES_PASSWORD="zabbix_pwd" \
-e POSTGRES_DB="zabbix" \
--network=zabbix-net \
--restart unless-stopped \
-d postgres:latest
docker run --name zabbix-snmptraps -t \
-v /zbx_instance/snmptraps:/var/lib/zabbix/snmptraps:rw \
-v /var/lib/zabbix/mibs:/usr/share/snmp/mibs:ro \
--network=zabbix-net \
-p 162:1162/udp \
--restart unless-stopped \
-d zabbix/zabbix-snmptraps:alpine-7.0-latest
docker run --name zabbix-server-pgsql -t \
-e DB_SERVER_HOST="postgres-server" \
-e POSTGRES_USER="zabbix" \
-e POSTGRES_PASSWORD="zabbix_pwd" \
-e POSTGRES_DB="zabbix" \
-e ZBX_ENABLE_SNMP_TRAPS="true" \
--network=zabbix-net \
-p 10051:10051 \
--volumes-from zabbix-snmptraps \
--restart unless-stopped \
-d zabbix/zabbix-server-pgsql:alpine-7.0-latest
docker run --name zabbix-web-nginx-pgsql -t \
-e ZBX_SERVER_HOST="zabbix-server-pgsql" \
-e DB_SERVER_HOST="postgres-server" \
-e POSTGRES_USER="zabbix" \
-e POSTGRES_PASSWORD="zabbix_pwd" \
-e POSTGRES_DB="zabbix" \
--network=zabbix-net \
-p 443:8443 \
-p 80:8080 \
-v /etc/ssl/nginx:/etc/ssl/nginx:ro \
--restart unless-stopped \
-d zabbix/zabbix-web-nginx-pgsql:alpine-7.0-latest
docker run -p 8083:80 \
-e 'PGADMIN_DEFAULT_EMAIL=user@domain.com' \
-e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' \
--network=zabbix-net \
-d dpage/pgadmin4
services:
postgres:
container_name: postgres-server
tty: true
environment:
- POSTGRES_USER=zabbix
- POSTGRES_PASSWORD=zabbix_pwd
- POSTGRES_DB=zabbix
networks:
- zabbix-net
restart: unless-stopped
image: postgres:latest
networks:
zabbix-net
zabbix-snmptraps:
container_name: zabbix-snmptraps
tty: true
volumes:
- /zbx_instance/snmptraps:/var/lib/zabbix/snmptraps:rw
- /var/lib/zabbix/mibs:/usr/share/snmp/mibs:ro
networks:
- zabbix-net
ports:
- 162:1162/udp
restart: unless-stopped
image: zabbix/zabbix-snmptraps:alpine-7.0-latest
zabbix-server-pgsql:
container_name: zabbix-server-pgsql
tty: true
environment:
- DB_SERVER_HOST=postgres-server
- POSTGRES_USER=zabbix
- POSTGRES_PASSWORD=zabbix_pwd
- POSTGRES_DB=zabbix
- ZBX_ENABLE_SNMP_TRAPS=true
ports:
- 10051:10051
volume_from:
- zabbix-snmptraps
restart: unless-stopped
image: zabbix/zabbix-server-pgsql:alpine-7.0-latest
networks:
zabbix-net
zabbix-web-nginx-pgsql:
container_name: zabbix-web-nginx-pgsql
tty: true
environment:
- ZBX_SERVER_HOST=zabbix-server-pgsql
- DB_SERVER_HOST=postgres-server
- POSTGRES_USER=zabbix
- POSTGRES_PASSWORD=zabbix_pwd
- POSTGRES_DB=zabbix
ports:
- 443:8443
- 80:8080
volumes:
- /etc/ssl/nginx:/etc/ssl/nginx:ro
restart: unless-stopped
image: zabbix/zabbix-web-nginx-pgsql:alpine-7.0-latest
networks:
zabbix-net
pgadmin4:
ports:
- 8083:80
environment:
- PGADMIN_DEFAULT_EMAIL=user@domain.com
- PGADMIN_DEFAULT_PASSWORD=SuperSecret
image: dpage/pgadmin4
networks:
zabbix-net
networks:
zabbix-net:
ipam:
driver: default
config:
- subnet: 172.28.0.0/16
- ip-range: 172.20.240.0/20
docker compose up -d
docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 zabbix-net
version: '3.7'
networks:
zabbix-net:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
ip_range: 172.20.240.0/20
services:
postgres-server:
image: postgres:latest
container_name: postgres-server
environment:
POSTGRES_USER: "zabbix"
POSTGRES_PASSWORD: "zabbix_pwd"
POSTGRES_DB: "zabbix"
networks:
zabbix-net:
restart: unless-stopped
zabbix-snmptraps:
image: zabbix/zabbix-snmptraps:alpine-7.0-latest
container_name: zabbix-snmptraps
volumes:
- /zbx_instance/snmptraps:/var/lib/zabbix/snmptraps:rw
- /var/lib/zabbix/mibs:/usr/share/snmp/mibs:ro
networks:
zabbix-net:
ports:
- "162:1162/udp"
restart: unless-stopped
zabbix-server-pgsql:
image: zabbix/zabbix-server-pgsql:alpine-7.0-latest
container_name: zabbix-server-pgsql
environment:
DB_SERVER_HOST: "postgres-server"
POSTGRES_USER: "zabbix"
POSTGRES_PASSWORD: "zabbix_pwd"
POSTGRES_DB: "zabbix"
ZBX_ENABLE_SNMP_TRAPS: "true"
networks:
zabbix-net:
ports:
- "10051:10051"
volumes:
- zabbix-snmptraps:/var/lib/zabbix/snmptraps:rw
restart: unless-stopped
zabbix-web-nginx-pgsql:
image: zabbix/zabbix-web-nginx-pgsql:alpine-7.0-latest
container_name: zabbix-web-nginx-pgsql
environment:
ZBX_SERVER_HOST: "zabbix-server-pgsql"
DB_SERVER_HOST: "postgres-server"
POSTGRES_USER: "zabbix"
POSTGRES_PASSWORD: "zabbix_pwd"
POSTGRES_DB: "zabbix"
networks:
zabbix-net:
ports:
- "443:8443"
- "80:8080"
volumes:
- /etc/ssl/nginx:/etc/ssl/nginx:ro
restart: unless-stopped
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: "user@domain.com"
PGADMIN_DEFAULT_PASSWORD: "SuperSecret"
networks:
zabbix-net:
ports:
- "8083:80"
restart: unless-stopped
volumes:
zabbix-snmptraps: