fix: switch to nginx for static export serving (fixes 502)
This commit is contained in:
16
Dockerfile
16
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
|
# Copy the static export to nginx html directory
|
||||||
ENV NODE_ENV production
|
COPY build /usr/share/nginx/html
|
||||||
ENV PORT 80
|
|
||||||
ENV HOSTNAME "0.0.0.0"
|
|
||||||
|
|
||||||
# Copy the pre-built standalone app from the build context
|
|
||||||
COPY build /app
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
CMD ["node", "server.js"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|||||||
Reference in New Issue
Block a user