mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-08 05:31:29 +08:00
fix: default to 0.0.0.0 instead of [::] for broader compatibility
This commit is contained in:
parent
6a83feecd6
commit
076bef68d3
@ -17,8 +17,8 @@ COPY docker/docker-entrypoint.sh /usr/local/bin/
|
|||||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||||
|
|
||||||
# Configuration via environment:
|
# Configuration via environment:
|
||||||
# GUNICORN_BIND - full bind address (default: [::]:8000, IPv4+IPv6)
|
# GUNICORN_BIND - full bind address (default: 0.0.0.0:8000)
|
||||||
# GUNICORN_HOST - bind host (default: [::])
|
# GUNICORN_HOST - bind host (default: 0.0.0.0)
|
||||||
# GUNICORN_PORT - bind port (default: 8000)
|
# GUNICORN_PORT - bind port (default: 8000)
|
||||||
# GUNICORN_WORKERS - number of workers (default: 2 * CPU + 1)
|
# GUNICORN_WORKERS - number of workers (default: 2 * CPU + 1)
|
||||||
# GUNICORN_ARGS - additional arguments (e.g., "--timeout 120")
|
# GUNICORN_ARGS - additional arguments (e.g., "--timeout 120")
|
||||||
|
|||||||
@ -6,9 +6,8 @@ if [ "${1:0:1}" = '-' ] || [ -z "${1##*:*}" ]; then
|
|||||||
# First arg is a flag or contains ':' (app:callable), run gunicorn
|
# First arg is a flag or contains ':' (app:callable), run gunicorn
|
||||||
|
|
||||||
# Build bind address from GUNICORN_HOST and GUNICORN_PORT, or use GUNICORN_BIND
|
# Build bind address from GUNICORN_HOST and GUNICORN_PORT, or use GUNICORN_BIND
|
||||||
# Default: listen on both IPv4 and IPv6
|
|
||||||
PORT="${GUNICORN_PORT:-8000}"
|
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
|
# Add bind if not specified in args or GUNICORN_ARGS
|
||||||
if [[ ! " $* $GUNICORN_ARGS " =~ " --bind " ]] && [[ ! " $* $GUNICORN_ARGS " =~ " -b " ]] && [[ ! "$* $GUNICORN_ARGS" =~ --bind= ]] && [[ ! "$* $GUNICORN_ARGS" =~ -b= ]]; then
|
if [[ ! " $* $GUNICORN_ARGS " =~ " --bind " ]] && [[ ! " $* $GUNICORN_ARGS " =~ " -b " ]] && [[ ! "$* $GUNICORN_ARGS" =~ --bind= ]] && [[ ! "$* $GUNICORN_ARGS" =~ -b= ]]; then
|
||||||
|
|||||||
@ -48,8 +48,8 @@ docker rm myapp
|
|||||||
|
|
||||||
| Variable | Description | Default |
|
| Variable | Description | Default |
|
||||||
|----------|-------------|---------|
|
|----------|-------------|---------|
|
||||||
| `GUNICORN_BIND` | Full bind address | `[::]:8000` (IPv4+IPv6) |
|
| `GUNICORN_BIND` | Full bind address | `0.0.0.0:8000` |
|
||||||
| `GUNICORN_HOST` | Bind host | `[::]` |
|
| `GUNICORN_HOST` | Bind host | `0.0.0.0` |
|
||||||
| `GUNICORN_PORT` | Bind port | `8000` |
|
| `GUNICORN_PORT` | Bind port | `8000` |
|
||||||
| `GUNICORN_WORKERS` | Number of workers | `(2 * CPU) + 1` |
|
| `GUNICORN_WORKERS` | Number of workers | `(2 * CPU) + 1` |
|
||||||
| `GUNICORN_ARGS` | Additional arguments | (none) |
|
| `GUNICORN_ARGS` | Additional arguments | (none) |
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user