Files
mqsrv/Dockerfile
2026-05-09 00:52:04 +08:00

29 lines
579 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 第一阶段: 构建
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
# 安装 OpenSSLPrisma 运行时依赖)
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"]