gateway issue

This commit is contained in:
2026-07-14 11:06:01 +05:30
parent 1a9a20f5d9
commit 46f70815af
2 changed files with 14 additions and 32 deletions

View File

@@ -1,26 +1,12 @@
FROM node:20-alpine
WORKDIR /app
# Next.js standalone runtime. Required because the contact form's Server
# Action (sendEmail.ts, SMTP via nodemailer) needs a live Node process -
# it cannot run under static/nginx serving.
ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME=0.0.0.0
# Copy the standalone build artifact (server.js, .next/, public/)
COPY build /app
# The standalone build was created on macOS (darwin-arm64), so it bundles
# macOS-only native binaries for sharp (image optimisation). These crash
# on Linux/Alpine. Replace them with the correct musl-linux-x64 binaries.
RUN rm -rf node_modules/@img/sharp-darwin-arm64 \
node_modules/@img/sharp-libvips-darwin-arm64 && \
npm install --no-save --platform=linuxmusl --arch=x64 \
@img/sharp-linuxmusl-x64@0.34.5 && \
rm -rf /tmp/* /root/.npm
EXPOSE 3000
CMD ["node", "server.js"]
FROM nginx:alpine
# Move to Nginx's public folder
WORKDIR /usr/share/nginx/html
# 1. CRUCIAL: Remove Nginx's default "Welcome" page files completely
RUN rm -rf ./*
# 2. Copy your compiled static assets into the root folder.
# NOTE: If your folder is named "dist" instead of "build", change "build/" to "dist/"
COPY build/ .
# 3. Copy your custom Nginx configuration (which you already have in your log)
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]