automated_api/Dockerfile
lixin 3b0f39e2ba
Some checks reported errors
continuous-integration/drone/push Build encountered an error
ci: 更新 Docker 镜像源并调整分支触发条件
- 将 Dockerfile 和 .drone.yml 中的 Docker 镜像源从官方更改为阿里云国内代理
- 修改 .drone.yml 中的触发分支,从 dev-2.0.0 改为 main 和 master
- 移除了 .drone.yml 中的事件触发条件配置
2025-01-10 14:42:35 +08:00

33 lines
646 B
Docker

# 构建阶段
FROM registry.cn-hangzhou.aliyuncs.com/library/node:18-alpine AS builder
WORKDIR /app
COPY package.json .
COPY package-lock.json* .
RUN npm config set registry https://registry.npmmirror.com/ && \
npm install
COPY . .
RUN npm run build
# 运行阶段
FROM registry.cn-hangzhou.aliyuncs.com/library/node:18-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package.json .
COPY --from=builder /app/bootstrap.js .
RUN npm config set registry https://registry.npmmirror.com/ && \
npm install --production
ENV NODE_ENV=production
ENV PORT=8001
EXPOSE 8001
CMD ["node", "bootstrap.js"]