Add Dockerfile template
CI Pipeline / Lint & Build (push) Has been cancelled
CI Pipeline / Build & Push Docker Image (push) Has been cancelled

This commit is contained in:
2026-07-08 18:30:43 +08:00
parent 40b9711940
commit 76be6eb766
+28
View File
@@ -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"]