From be14d3a62ba0ae10404b2e1ce2ec0f568fa4ec80 Mon Sep 17 00:00:00 2001 From: ShareVB Date: Fri, 2 Jan 2026 21:39:50 +0100 Subject: [PATCH] fix(Docker): allow PORT environment variable Taken from #1670 Fix #1450 and #224 --- Dockerfile | 7 +++++-- nginx.conf | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index c3f19d68..f21b974f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,9 @@ ENV VITE_VERCEL_ENV production ARG BASE_URL ENV BASE_URL=${BASE_URL} COPY --from=build-stage /app/dist /usr/share/nginx/html -COPY nginx.conf /etc/nginx/conf.d/default.conf -EXPOSE 8080 + +COPY nginx.conf /etc/nginx/templates/default.conf.template +ENV PORT=8080 +EXPOSE $PORT + CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf index 583a12a6..2f116c05 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,6 +1,6 @@ server { - listen 8080; - listen [::]:8080; + listen ${PORT}; + listen [::]:${PORT}; server_name _; root /usr/share/nginx/html; index index.html;