From 176754c1c491f474a1622c5ced3e13f66d4851cf Mon Sep 17 00:00:00 2001 From: Kunthawat Greethong Date: Fri, 13 Mar 2026 09:31:45 +0700 Subject: [PATCH] Use serve instead of astro preview (fix Vite allowedHosts bug) --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 37326e4cc..98816a40b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,11 @@ COPY package*.json ./ RUN npm install COPY . . RUN npm run build + FROM node:20-alpine WORKDIR /app -COPY package*.json ./ -RUN npm install --omit=dev COPY --from=builder /app/dist ./dist -RUN apk add --no-cache sqlite-libs +RUN npm install -g serve EXPOSE 80 -ENV NODE_ENV=production HOST=0.0.0.0 PORT=80 -CMD ["npx", "astro", "preview", "--host", "0.0.0.0", "--port", "80"] +ENV NODE_ENV=production +CMD ["serve", "-s", "dist", "-l", "80", "--listen-addr", "0.0.0.0"]