From d8083177ce13b22cb03e2451fab2eb055d7148e7 Mon Sep 17 00:00:00 2001 From: Aravind Date: Mon, 13 Jul 2026 19:12:25 +0530 Subject: [PATCH] fix: switch to nginx for static export serving (fixes 502) --- Dockerfile | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3b8fb94..5ab9e36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,11 @@ -FROM node:18-alpine +FROM nginx:alpine -WORKDIR /app +# Copy custom nginx config +COPY nginx.conf /etc/nginx/nginx.conf -# Next.js standalone config and environment -ENV NODE_ENV production -ENV PORT 80 -ENV HOSTNAME "0.0.0.0" - -# Copy the pre-built standalone app from the build context -COPY build /app +# Copy the static export to nginx html directory +COPY build /usr/share/nginx/html EXPOSE 80 -CMD ["node", "server.js"] +CMD ["nginx", "-g", "daemon off;"]