zabbix_server:
docker run --name zabbix_server \
-e DB_SERVER_HOST="zabbix_pq" \
-e POSTGRES_USER="postgres" \
-e POSTGRES_PASSWORD="zxc0" \
--restart=always --network zabbix_net \
-d zabbix/zabbix-server-pgsql:alpine-latest
zabbix_pq:
docker run --name zabbix_pq \
-e POSTGRES_PASSWORD=zxc0 \
--restart=always \
--network zabbix_net \
-d postgres
zabbix_web:
docker run --name zabbix_web -e DB_SERVER_HOST="zabbix_pq" -e POSTGRES_USER="postgres" -e POSTGRES_PASSWORD="zxc0" \
-e ZBX_SERVER_HOST="zabbix_server" -e PHP_TZ="Asia/Shanghai" \
-p 8080:8080 \
--restart=always --network=zabbix_net \
-d zabbix/zabbix-web-nginx-pgsql:alpine-latest
zabbix_agent:
docker run --name zabbix_agent -e ZBX_HOSTNAME="Zabbix server" -e ZBX_SERVER_HOST="127.0.0.1" \
-e ZBX_UNSAFEUSERPARAMETERS=1 \
-v /var/run/docker.sock:/var/run/docker.sock \
--restart=always --network=container:zabbix_server \
-d zabbix/zabbix-agent2:alpine-latest