From f242b174b96155caa44e2249964646c9f47593e3 Mon Sep 17 00:00:00 2001 From: HHY Date: Thu, 24 Sep 2026 20:56:53 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BA=91=E7=AB=AF=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E2=80=94=E2=80=94=E7=A7=BB=E9=99=A4=20.docke?= =?UTF-8?q?rignore=20=E4=B8=AD=E6=96=87=E6=96=87=E4=BB=B6=E5=90=8D(ACR=20e?= =?UTF-8?q?xclude-patterns=20=E4=BB=85=E6=94=B6=20ASCII),=20uv=20=E6=94=B9?= =?UTF-8?q?=20PyPI=20=E5=AE=89=E8=A3=85,=20npm/PyPI=20=E8=B5=B0=E5=9B=BD?= =?UTF-8?q?=E5=86=85=E9=95=9C=E5=83=8F=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 2 -- Dockerfile | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.dockerignore b/.dockerignore index a124525..19eac79 100644 --- a/.dockerignore +++ b/.dockerignore @@ -27,6 +27,4 @@ data/api-endpoint-inventory.txt data/fetch-images.py # 杂项 -image.png -3D窗型.png .env diff --git a/Dockerfile b/Dockerfile index cff567e..4558b47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ # syntax=docker/dockerfile:1 # 华门窗云平台镜像(多阶段:前端构建 → Python 运行时) # 云端构建: git 仓库直接构建即可; 本地: docker build -t menchuang . +# 注: npm/PyPI 默认走国内镜像源(npmmirror/清华), 海外构建可用 --build-arg 覆盖 # ---------- 阶段 1: 前端构建 (Vue3 + Vite → dist) ---------- FROM node:22-alpine AS web WORKDIR /web +RUN npm config set registry https://registry.npmmirror.com COPY frontend/package.json frontend/package-lock.json ./ RUN npm ci COPY frontend/ ./ @@ -12,11 +14,11 @@ RUN npm run build # ---------- 阶段 2: 后端运行时 (Python 3.14 + uv) ---------- FROM python:3.14-slim-bookworm - -# uv 包管理器(按 uv.lock 冻结安装) -COPY --from=ghcr.io/astral-sh/uv:0.9 /uv /usr/local/bin/uv +# uv 经 PyPI 安装(避免对 ghcr.io 的依赖); 国内构建走清华源 +RUN pip install --no-cache-dir "uv>=0.9,<0.10" ENV UV_COMPILE_BYTECODE=1 \ UV_LINK_MODE=copy \ + UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple \ TZ=Asia/Shanghai WORKDIR /app