chore: mqsrv backend
This commit is contained in:
28
Dockerfile
Normal file
28
Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
||||
# 第一阶段: 构建
|
||||
FROM node:22-alpine AS builder
|
||||
WORKDIR /app
|
||||
|
||||
# 安装必要的系统依赖(Prisma 需要)
|
||||
RUN apk add --no-cache openssl
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
RUN npx prisma generate
|
||||
RUN npx tsc
|
||||
|
||||
# 第二阶段: 运行
|
||||
FROM node:22-alpine
|
||||
WORKDIR /app
|
||||
|
||||
# 安装 OpenSSL(Prisma 运行时依赖)
|
||||
RUN apk add --no-cache openssl
|
||||
|
||||
COPY --from=builder /app/package*.json ./
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
|
||||
EXPOSE 3001
|
||||
CMD ["node", "dist/index.js"]
|
||||
Reference in New Issue
Block a user