From 57935ae0df5105cf7d5a4fb173ad13a4e73bb0e3 Mon Sep 17 00:00:00 2001 From: Paul Johnson Date: Wed, 29 Oct 2025 00:34:24 +0000 Subject: [PATCH] Make it possible to override nginx listen port in container --- Dockerfile | 7 +++++-- nginx.conf | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 734bd73d..e3bff3df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,9 @@ RUN pnpm build # production stage FROM nginx:stable-alpine AS production-stage COPY --from=build-stage /app/dist /usr/share/nginx/html -COPY nginx.conf /etc/nginx/conf.d/default.conf -EXPOSE 80 +COPY nginx.conf /etc/nginx/templates/default.conf.template + +ENV PORT=80 +EXPOSE $PORT + CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf index 1a30e15e..ceb6d322 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,5 +1,5 @@ server { - listen 80; + listen ${PORT}; server_name localhost; root /usr/share/nginx/html; index index.html;