Files
templates/blueprints/zulip/docker-compose.yml
Mauricio Siu 56df572522 fix: trust Dokploy's Traefik proxy via LOADBALANCER_IPS
Zulip 12 rejects requests forwarded by an untrusted reverse proxy with
a 500 "Proxy-Misconfiguration: Incorrect reverse proxy IPs set in
Zulip" error page. TRUST_GATEWAY_IP=True only whitelists the
container's default-route gateway IP, but Dokploy's Traefik connects
from its own container IP on the (dynamically-subnetted) compose
network, so it was never trusted.

Replace TRUST_GATEWAY_IP with LOADBALANCER_IPS covering the RFC1918
ranges, which Zulip feeds into nginx set_real_ip_from / its trusted
proxy list, so Traefik is trusted regardless of which Docker subnet it
connects from.

Also align meta.json version with the shipped image tag (12.1-0).

Note: the zulip-server image ships a HEALTHCHECK (/health, 300s start
period) and first boot runs full migrations, so Traefik only exposes
the router once the container turns healthy — expect several minutes
of 404 on the domain right after the first deploy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 01:24:58 -06:00

114 lines
3.1 KiB
YAML

version: "3.8"
services:
database:
image: zulip/zulip-postgresql:14
restart: unless-stopped
secrets:
- zulip__postgres_password
environment:
POSTGRES_DB: zulip
POSTGRES_USER: zulip
POSTGRES_PASSWORD_FILE: /run/secrets/zulip__postgres_password
volumes:
- zulipPostgresData:/var/lib/postgresql/data
memcached:
image: memcached:alpine
restart: unless-stopped
command:
- sh
- -euc
- |
echo 'mech_list: plain' > "$$SASL_CONF_PATH"
echo "zulip@$$HOSTNAME:$$(cat $$MEMCACHED_PASSWORD_FILE)" > "$$MEMCACHED_SASL_PWDB"
echo "zulip@localhost:$$(cat $$MEMCACHED_PASSWORD_FILE)" >> "$$MEMCACHED_SASL_PWDB"
exec memcached -S
secrets:
- zulip__memcached_password
environment:
SASL_CONF_PATH: /home/memcache/memcached.conf
MEMCACHED_SASL_PWDB: /home/memcache/memcached-sasl-db
MEMCACHED_PASSWORD_FILE: /run/secrets/zulip__memcached_password
rabbitmq:
image: rabbitmq:4.2
restart: unless-stopped
command:
- sh
- -euc
- |
export RABBITMQ_DEFAULT_PASS="$$(cat $$RABBITMQ_PASSWORD_FILE)"
echo "default_user = $$RABBITMQ_DEFAULT_USER" >> /etc/rabbitmq/rabbitmq.conf
echo "default_pass = $$RABBITMQ_DEFAULT_PASS" >> /etc/rabbitmq/rabbitmq.conf
exec docker-entrypoint.sh rabbitmq-server
secrets:
- zulip__rabbitmq_password
environment:
RABBITMQ_DEFAULT_USER: zulip
RABBITMQ_PASSWORD_FILE: /run/secrets/zulip__rabbitmq_password
volumes:
- zulipRabbitmqData:/var/lib/rabbitmq
redis:
image: redis:alpine
restart: unless-stopped
command:
- sh
- -euc
- /usr/local/bin/docker-entrypoint.sh --requirepass "$$(cat $$REDIS_PASSWORD_FILE)"
secrets:
- zulip__redis_password
environment:
REDIS_PASSWORD_FILE: /run/secrets/zulip__redis_password
volumes:
- zulipRedisData:/data
zulip:
image: ghcr.io/zulip/zulip-server:12.1-0
restart: unless-stopped
depends_on:
- database
- memcached
- rabbitmq
- redis
secrets:
- zulip__postgres_password
- zulip__memcached_password
- zulip__rabbitmq_password
- zulip__redis_password
- zulip__secret_key
environment:
SETTING_EXTERNAL_HOST: ${ZULIP_EXTERNAL_HOST}
SETTING_ZULIP_ADMINISTRATOR: ${ZULIP_ADMINISTRATOR}
SETTING_REMOTE_POSTGRES_HOST: database
SETTING_MEMCACHED_LOCATION: memcached:11211
SETTING_RABBITMQ_HOST: rabbitmq
SETTING_REDIS_HOST: redis
CONFIG_application_server__http_only: "true"
LOADBALANCER_IPS: ${ZULIP_LOADBALANCER_IPS}
volumes:
- zulipData:/data
ulimits:
nofile:
soft: 1000000
hard: 1048576
volumes:
zulipData:
zulipPostgresData:
zulipRabbitmqData:
zulipRedisData:
secrets:
zulip__postgres_password:
environment: ZULIP_POSTGRES_PASSWORD
zulip__memcached_password:
environment: ZULIP_MEMCACHED_PASSWORD
zulip__rabbitmq_password:
environment: ZULIP_RABBITMQ_PASSWORD
zulip__redis_password:
environment: ZULIP_REDIS_PASSWORD
zulip__secret_key:
environment: ZULIP_SECRET_KEY