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
|
||||
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;"]
|
||||
|
||||
Reference in New Issue
Block a user