From 26aee34163aecd0bc48770ad52f350b2b0fa0233 Mon Sep 17 00:00:00 2001 From: Greg Date: Tue, 20 May 2025 20:55:06 +0200 Subject: [PATCH] Dockerized --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..72a714c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# Production-ready Dockerfile for Astro +FROM node:20-alpine AS builder +WORKDIR /app +COPY . . +RUN npm ci && npm run build + +# Production image +FROM node:20-alpine AS runner +WORKDIR /app +COPY --from=builder /app/package.json ./ +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/dist ./dist +COPY --from=builder /app/public ./public + +VOLUME ["/app/public", "/app/src/content"] + +EXPOSE 4321 +CMD ["npx", "astro", "preview"]