This commit is contained in:
2026-07-01 09:22:26 +00:00
parent 4aa1dab283
commit aa47a19e98
53 changed files with 4721 additions and 77 deletions
+15 -1
View File
@@ -2,12 +2,24 @@
FROM node:22-alpine AS frontend-builder
WORKDIR /app/frontend
# Install dependencies and build the static assets
# 主前端
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ .
RUN npm run build
# 重型插件前端:每个插件独立 vite lib build,输出 dist/plugin-element.js + wc-manifest.json
# 这一段通过 sh 循环:复制源码 → npm install → build。任何一个插件失败都会让镜像构建失败,
# 用 || true 兜底过于宽松——这里选择硬失败,便于第一时间发现 build 问题。
COPY data/plugin /app/data/plugin
RUN set -e; \
for d in /app/data/plugin/*/frontend; do \
if [ -f "$d/package.json" ]; then \
echo "==> Building plugin frontend: $d"; \
cd "$d" && npm install && npm run build; \
fi; \
done
# Stage 2: Build the Python backend and serve
FROM python:3.13-slim
WORKDIR /app
@@ -36,6 +48,8 @@ COPY . .
# Copy the built frontend static assets from Stage 1
COPY --from=frontend-builder /app/frontend/dist /app/frontend/dist
# 重型插件前端 build 产物(让 /plugin-ui/<name>/ 静态挂载有内容可挂)
COPY --from=frontend-builder /app/data/plugin /app/data/plugin
# Expose FastAPI and Ray Dashboard ports
EXPOSE 8000 8265