From 076bef68d3a0034699ffc18a266596386175a0f5 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 19:19:38 +0100 Subject: [PATCH] fix: default to 0.0.0.0 instead of [::] for broader compatibility --- docker/Dockerfile | 4 ++-- docker/docker-entrypoint.sh | 3 +-- docs/content/guides/docker.md | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0aae4353..242d628c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -17,8 +17,8 @@ COPY docker/docker-entrypoint.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/docker-entrypoint.sh # Configuration via environment: -# GUNICORN_BIND - full bind address (default: [::]:8000, IPv4+IPv6) -# GUNICORN_HOST - bind host (default: [::]) +# GUNICORN_BIND - full bind address (default: 0.0.0.0:8000) +# GUNICORN_HOST - bind host (default: 0.0.0.0) # GUNICORN_PORT - bind port (default: 8000) # GUNICORN_WORKERS - number of workers (default: 2 * CPU + 1) # GUNICORN_ARGS - additional arguments (e.g., "--timeout 120") diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 125716ed..04fd606a 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -6,9 +6,8 @@ if [ "${1:0:1}" = '-' ] || [ -z "${1##*:*}" ]; then # First arg is a flag or contains ':' (app:callable), run gunicorn # Build bind address from GUNICORN_HOST and GUNICORN_PORT, or use GUNICORN_BIND - # Default: listen on both IPv4 and IPv6 PORT="${GUNICORN_PORT:-8000}" - BIND="${GUNICORN_BIND:-${GUNICORN_HOST:-[::]}:${PORT}}" + BIND="${GUNICORN_BIND:-${GUNICORN_HOST:-0.0.0.0}:${PORT}}" # Add bind if not specified in args or GUNICORN_ARGS if [[ ! " $* $GUNICORN_ARGS " =~ " --bind " ]] && [[ ! " $* $GUNICORN_ARGS " =~ " -b " ]] && [[ ! "$* $GUNICORN_ARGS" =~ --bind= ]] && [[ ! "$* $GUNICORN_ARGS" =~ -b= ]]; then diff --git a/docs/content/guides/docker.md b/docs/content/guides/docker.md index e01a6623..c05afdfb 100644 --- a/docs/content/guides/docker.md +++ b/docs/content/guides/docker.md @@ -48,8 +48,8 @@ docker rm myapp | Variable | Description | Default | |----------|-------------|---------| -| `GUNICORN_BIND` | Full bind address | `[::]:8000` (IPv4+IPv6) | -| `GUNICORN_HOST` | Bind host | `[::]` | +| `GUNICORN_BIND` | Full bind address | `0.0.0.0:8000` | +| `GUNICORN_HOST` | Bind host | `0.0.0.0` | | `GUNICORN_PORT` | Bind port | `8000` | | `GUNICORN_WORKERS` | Number of workers | `(2 * CPU) + 1` | | `GUNICORN_ARGS` | Additional arguments | (none) |