From 71ee1e2ca66e91698efb900965f7b68d6b515506 Mon Sep 17 00:00:00 2001 From: "mula.liu" Date: Mon, 2 Mar 2026 01:33:23 +0800 Subject: [PATCH] fix bugs --- .env.prod.example | 2 +- frontend/Dockerfile | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.env.prod.example b/.env.prod.example index 404d39d..94e78b8 100644 --- a/.env.prod.example +++ b/.env.prod.example @@ -20,7 +20,7 @@ NGINX_BASE_IMAGE=nginx:alpine PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple PIP_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn -# NPM registry mirror (recommended in CN) +# Frontend package registry mirror (used by yarn, recommended in CN) NPM_REGISTRY=https://registry.npmmirror.com # Optional DB override. diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 5847d8f..65bc75b 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -6,9 +6,10 @@ WORKDIR /app ARG NPM_REGISTRY=https://registry.npmjs.org/ -COPY package*.json ./ -RUN npm config set registry "${NPM_REGISTRY}" \ - && if [ -f package-lock.json ] || [ -f npm-shrinkwrap.json ]; then npm ci; else npm install --no-audit --fund=false; fi +COPY package.json yarn.lock ./ +RUN corepack enable \ + && yarn config set registry "${NPM_REGISTRY}" \ + && yarn install --frozen-lockfile --network-timeout 120000 COPY . . @@ -17,7 +18,7 @@ ARG VITE_WS_BASE=/ws/monitor ENV VITE_API_BASE=${VITE_API_BASE} ENV VITE_WS_BASE=${VITE_WS_BASE} -RUN npm run build +RUN yarn build FROM ${NGINX_BASE_IMAGE}