From 7cee426f820b9ee1c85b93ded473af01da519051 Mon Sep 17 00:00:00 2001 From: Kunthawat Greethong Date: Fri, 13 Mar 2026 09:47:32 +0700 Subject: [PATCH] Use nginx (official Astro recommendation) --- Dockerfile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 68777610c..0307142e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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;"]