From 0fcc526c46e4007a685c8626cf73d7c08890f763 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Thu, 21 May 2026 06:47:44 +0200 Subject: [PATCH] =?UTF-8?q?fix(docker):=20use=20plain=20\${PORT}=20in=20ng?= =?UTF-8?q?inx=20template=20=E2=80=94=20envsubst=20can't=20expand=20bash?= =?UTF-8?q?=20defaults?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `listen ${PORT:-8080};` in docker/nginx.conf used bash-style default expansion. envsubst (GNU gettext) does not implement `:-default`; it either leaves the token literal or substitutes only `${PORT}` and keeps `:-8080`, producing `listen 8080:-8080;`. Either way nginx errors with "invalid port in '${PORT:-8080}' of the listen directive" and the container restart-loops. entrypoint.sh already exports PORT with a bash default (`PORT="${PORT:-8080}"`) before calling envsubst, so the template only needs `${PORT}`. Co-Authored-By: Claude Opus 4.7 (1M context) --- docker/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/nginx.conf b/docker/nginx.conf index d3df7789..7169bbe6 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -1,5 +1,5 @@ server { - listen ${PORT:-8080}; + listen ${PORT}; server_name _; root /usr/share/nginx/html;