99AI/Dockerfile
2024-05-21 19:32:36 +08:00

30 lines
698 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:18-alpine AS base
FROM base AS build
WORKDIR /app
COPY package.json ./
# 使用腾讯源(国内服务器可取消下方注释以提升安装速度)
# RUN npm config set registry https://mirrors.cloud.tencent.com/npm/
# 如遇到提示网站证书无效取消下方注释禁止严格SS策略
# RUN npm config set strict-ssl false
# 使用淘宝源安装项目依赖(国内用户居多)
RUN npm config set registry https://registry.npmmirror.com && \
npm install --omit=dev
# 运行阶段
FROM base AS runner
ENV TZ="Asia/Shanghai"
WORKDIR /app
COPY --from=build /app/node_modules ./node_modules
COPY . .
EXPOSE 9520
CMD ["node", "./dist/main.js"]