This commit is contained in:
aaron 2025-03-06 19:31:23 +08:00
parent a47fb3e58c
commit 9cc9389c3f

View File

@ -10,16 +10,16 @@ ENV NODE_ENV=${NODE_ENV}
# 复制 package.json 和 package-lock.json
COPY package*.json ./
# 安装 yarn 并使用 yarn 安装依赖
RUN npm install -g yarn && \
yarn config set registry https://registry.npmmirror.com && \
yarn install
RUN npm config set registry http://mirrors.cloud.tencent.com/npm/
# 复制项目文件
# 安装依赖
RUN npm install
# 复制源代码
COPY . .
# 构建应用
RUN yarn build
RUN npm run build
# 生产阶段
FROM nginx:stable-alpine