fix docker and nginx file
This commit is contained in:
30
Dockerfile
30
Dockerfile
@@ -1,12 +1,18 @@
|
||||
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;"]
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the standalone build output
|
||||
COPY build/ ./
|
||||
|
||||
# Next.js standalone collects all needed node_modules during build,
|
||||
# so no `npm install` is necessary here.
|
||||
|
||||
# Expose the port that server.js listens on
|
||||
EXPOSE 3000
|
||||
|
||||
ENV PORT=3000
|
||||
ENV HOSTNAME="0.0.0.0"
|
||||
ENV NODE_ENV=production
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
Reference in New Issue
Block a user