From 76be6eb766200467b16d8365a25ed5a7840ad669 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 8 Jul 2026 18:30:43 +0800 Subject: [PATCH] Add Dockerfile template --- Dockerfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a01bf70 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# syntax=docker/dockerfile:1 + +# Build stage +FROM git.xiaoxiajianji.com/xiaoxia/base/node:20 AS builder + +WORKDIR /app + +COPY package*.json ./ +RUN npm ci + +COPY . . +RUN npm run build + +# Production stage +FROM git.xiaoxiajianji.com/xiaoxia/base/node:20-alpine AS production + +WORKDIR /app + +ENV NODE_ENV=production + +COPY package*.json ./ +RUN npm ci --omit=dev && npm cache clean --force + +COPY --from=builder /app/dist ./dist + +EXPOSE 3000 + +CMD ["node", "dist/index.js"]