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 WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN npm install RUN npm install
COPY . . COPY . .
RUN npm run build RUN npm run build
FROM node:20-alpine FROM nginx:alpine AS runtime
WORKDIR /app COPY --from=build /app/dist /usr/share/nginx/html
COPY --from=builder /app/dist ./dist
RUN npm install -g serve
EXPOSE 80 EXPOSE 80
ENV NODE_ENV=production CMD ["nginx", "-g", "daemon off;"]
CMD ["serve", "-s", "dist", "-l", "0.0.0.0:80"]