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 # 复制 package.json 和 package-lock.json
COPY package*.json ./ COPY package*.json ./
# 安装 yarn 并使用 yarn 安装依赖 RUN npm config set registry http://mirrors.cloud.tencent.com/npm/
RUN npm install -g yarn && \
yarn config set registry https://registry.npmmirror.com && \
yarn install
# 复制项目文件 # 安装依赖
RUN npm install
# 复制源代码
COPY . . COPY . .
# 构建应用 # 构建应用
RUN yarn build RUN npm run build
# 生产阶段 # 生产阶段
FROM nginx:stable-alpine FROM nginx:stable-alpine