Listen on [::] so the app is reachable on IPv6-only clusters

gunicorn bound to 0.0.0.0:8000, which is IPv4 only. On an IPv6-only
network (ungleich's clusters are IPv6 first) every request and probe
failed. [::] is dual-stack on Linux. Checked on an IPv6-only and on an
IPv4-only Docker network: both probes answer, and migrations reach
PostgreSQL by hostname over IPv6.
This commit is contained in:
sajeyks 2026-11-10 14:50:45 +03:00
commit c7dd2be8bc

View file

@ -1,7 +1,9 @@
"""Gunicorn settings; each can be overridden with GUNICORN_* env vars."""
import os
bind = os.environ.get("GUNICORN_BIND", "0.0.0.0:8000")
# [::] is dual-stack on Linux: it accepts IPv6 and IPv4. 0.0.0.0 would be
# IPv4 only and unreachable on IPv6-only clusters.
bind = os.environ.get("GUNICORN_BIND", "[::]:8000")
# Threaded workers: requests mostly wait on LDAP, SMTP and the OTP server.
worker_class = "gthread"
workers = int(os.environ.get("GUNICORN_WORKERS", "2"))