Replace nginx with Node.js static server for Easypanel
Some checks failed
Deploy to Easypanel / deploy (push) Has been cancelled

This commit is contained in:
Kunthawat Greethong
2026-04-28 07:48:45 +07:00
parent 57983587b3
commit ad3bd39c2d
6 changed files with 91 additions and 13 deletions

View File

@@ -1,4 +1,3 @@
# Build stage
FROM node:22-alpine AS builder
WORKDIR /app
@@ -8,17 +7,16 @@ RUN npm install
COPY . .
RUN npm run build
# Static files stage
FROM nginx:alpine AS runner
FROM node:22-alpine AS runner
WORKDIR /app
# Copy static files from builder
ENV PORT=8080
ENV DIST_DIR=./dist
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/server.js .
# Copy nginx config
COPY nginx.conf /etc/nginx/http.d/default.conf
EXPOSE 8080
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
CMD ["node", "server.js"]