From 9d9f03001ea30ececc12af03e052a144f9aa0e1a Mon Sep 17 00:00:00 2001 From: Timothy Stott Date: Sun, 28 Dec 2025 20:54:01 +0000 Subject: [PATCH] Add IPv6 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change remains backward compatible, as IPv6 support is disabled by default. Nginx fails to start when an IPv6 `listen` directive is specified on an IPv4-only host, preventing a single configuration from supporting both protocols. To work around this limitation, the Docker image build process now generates a separate copy of the Nginx configuration for IPv6. An environment variable can be used to select either the IPv4 or IPv6 configuration when launching the container. By embedding both configurations during the image build, we avoid making file system changes at runtime — a step toward an immutable filesystem design. --- Dockerfile | 2 ++ supervisord.conf | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c71e41d3..9d8e9d81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,8 @@ COPY ./requirements.txt /requirements.txt COPY ./entrypoint.sh /entrypoint.sh COPY ./supervisord.conf /etc/supervisord.conf COPY ./nginx.conf /etc/nginx/nginx.conf +# Generate a copy of the nginx config with IPv6 support. +RUN sed 's/listen 8000;/listen 8000; listen [::]:8000;/' /etc/nginx/nginx.conf > /etc/nginx/nginx.ipv6.conf WORKDIR /yamtrack diff --git a/supervisord.conf b/supervisord.conf index bb564d02..537506a8 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -3,7 +3,7 @@ nodaemon=true user=root [program:nginx] -command=nginx -g 'daemon off;' +command=sh -c 'if [ "${YAMTRACK_IPV6_ENABLED:-False}" = "True" ]; then CONF=/etc/nginx/nginx.ipv6.conf; else CONF=/etc/nginx/nginx.conf; fi; nginx -c $CONF -g "daemon off;"' user=root priority=1 stdout_logfile=/dev/stdout