fix docker port
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -17,12 +17,10 @@ ENV NODE_ENV=production
|
|||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Stage 3: Production runner with Nginx reverse proxy
|
# Stage 3: Production runner with Next.js Standalone
|
||||||
FROM node:22-alpine AS runner
|
FROM node:22-alpine AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apk add --no-cache nginx
|
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
@@ -33,10 +31,6 @@ COPY --from=builder /app/public ./public
|
|||||||
COPY --from=builder /app/.next/standalone ./
|
COPY --from=builder /app/.next/standalone ./
|
||||||
COPY --from=builder /app/.next/static ./.next/static
|
COPY --from=builder /app/.next/static ./.next/static
|
||||||
|
|
||||||
# Copy custom Nginx configuration
|
EXPOSE 3000
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
|
||||||
|
|
||||||
EXPOSE 80
|
CMD ["node", "server.js"]
|
||||||
|
|
||||||
# Start Next.js standalone server in background and Nginx in foreground
|
|
||||||
CMD ["sh", "-c", "node server.js & nginx -g 'daemon off;'"]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user