fix: 云端构建兼容——移除 .dockerignore 中文文件名(ACR exclude-patterns 仅收 ASCII), uv 改 PyPI 安装, npm/PyPI 走国内镜像源
This commit is contained in:
@@ -27,6 +27,4 @@ data/api-endpoint-inventory.txt
|
||||
data/fetch-images.py
|
||||
|
||||
# 杂项
|
||||
image.png
|
||||
3D窗型.png
|
||||
.env
|
||||
|
||||
+5
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user