main
mula.liu 2026-03-02 01:33:23 +08:00
parent e3b134d943
commit 71ee1e2ca6
2 changed files with 6 additions and 5 deletions

View File

@ -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.

View File

@ -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}