Use nginx (official Astro recommendation)

This commit is contained in:
Kunthawat Greethong
2026-03-13 09:47:32 +07:00
parent 6e71bf60b8
commit 7cee426f82

View File

@@ -1,14 +1,11 @@
FROM node:20-alpine AS builder
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM node:20-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
RUN npm install -g serve
FROM nginx:alpine AS runtime
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
ENV NODE_ENV=production
CMD ["serve", "-s", "dist", "-l", "0.0.0.0:80"]
CMD ["nginx", "-g", "daemon off;"]