Files
xiaoxia-saas/infra/docker/api-base.Dockerfile
T
saas-backend 1584a85bab
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 1s
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 2m48s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 7m20s
AI Code Review / AI Code Review (pull_request) Successful in 7m43s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 20s
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 12s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 10m48s
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Style (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
feat(#2001): 爆款标题样式面板后端支持
- SubtitleStyle 新增 line_overrides 字段,支持逐行独立样式覆盖
  (color/font_size/font/bold/italic/stroke_color/stroke_width/shadow)
  通过 ASS 内联 override 标签 {\c&H...\fsN\fn...} 实现
- ass_subtitle_builder 在标题/字幕换行后应用 line_overrides
- AiAvatarRenderJob 新增 cover_title_config 字段(封面独立标题配置,结构同 title_config)
- Alembic 迁移 083: ai_avatar_render_jobs.cover_title_config JSON NOT NULL 默认 {}
- Schema/Service/Route 全链路透传 cover_title_config
- 部署 4 款爆款字体到 /usr/share/fonts/truetype/xiaoxia/:
  优设标题黑、阿里普惠体 Bold 2.0、抖音美好体、思源黑体 Heavy
- FONT_NAME_MAP + DRAWTEXT_FONT_MAP + DRAWTEXT_FONT_SEARCH_PATHS 全量扩展
- 单元测试 24 个覆盖 line_overrides 逐行标签/负数索引/全字段组合/异常过滤
- 覆盖 #1263 标题预设 T 图标能力(通过 line_overrides 首行大字号+粗体实现)
2026-09-20 21:57:54 +08:00

66 lines
3.2 KiB
Docker

# ============================================================
# API 基础镜像(预构建)
# 预装系统依赖 + Python 依赖,业务构建从此镜像开始
# 当 requirements-base.txt 或 requirements.txt 变更时重新构建
# 目标:将 API Image 构建时间从 15-20 分钟降至 3-5 分钟
# ============================================================
FROM git.xiaoxiajianji.com/xiaoxia/base/python:3.12-slim
# 使用阿里云镜像加速
RUN sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || \
sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list 2>/dev/null || true
# 预装系统依赖(gcc 编译 psycopg/pg 扩展,libpq-dev 编译期,libpq5 运行期,ffmpeg 封面取帧)
# 字体修复:fonts-noto-cjk 包的 Sans .ttc 文件混入了 Mono 变体,导致 Bold 匹配到等宽字体
# 解决方案:删除 Sans .ttc,保留 Serif .ttc;仓库内预下载 VF 可变字体(不含 Mono)
# #1896 补充开源字体:NotoSerifCJKsc-VF.otf(思源宋体)、LXGWWenKai-Regular.ttf(霞鹜文楷开源楷体)
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
libpq5 \
ffmpeg \
fonts-noto-cjk \
&& rm -rf /var/lib/apt/lists/* \
# 删除有问题的 Sans .ttc(含 Mono 变体),保留 Serif .ttc 作为宋体 fallback
&& rm -f /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc \
&& rm -f /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc \
&& mkdir -p /usr/share/fonts/truetype/lxgw
# 复制开源中文字体:思源黑体 VF + 思源宋体 VF(#1896)+ 霞鹜文楷(#1896,开源楷体)
COPY infra/fonts/NotoSansSC-VF.ttf /usr/share/fonts/opentype/noto/NotoSansSC-VF.ttf
COPY infra/fonts/NotoSerifCJKsc-VF.otf /usr/share/fonts/opentype/noto/NotoSerifCJKsc-VF.otf
COPY infra/fonts/LXGWWenKai-Regular.ttf /usr/share/fonts/truetype/lxgw/LXGWWenKai-Regular.ttf
# #2001 爆款标题字体:优设标题黑 / 阿里普惠体 Bold / 抖音美好体 / 思源黑体 Heavy
RUN mkdir -p /usr/share/fonts/truetype/xiaoxia
COPY infra/fonts/xiaoxia/YouSheBiaoTiHei.ttf /usr/share/fonts/truetype/xiaoxia/YouSheBiaoTiHei.ttf
COPY infra/fonts/xiaoxia/AlibabaPuHuiTi-Bold.ttf /usr/share/fonts/truetype/xiaoxia/AlibabaPuHuiTi-Bold.ttf
COPY infra/fonts/xiaoxia/DouyinSansBold.otf /usr/share/fonts/truetype/xiaoxia/DouyinSansBold.otf
COPY infra/fonts/xiaoxia/NotoSansSC-Black.otf /usr/share/fonts/truetype/xiaoxia/NotoSansSC-Black.otf
RUN fc-cache -fv
# 创建虚拟环境
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
WORKDIR /tmp
# 预装 Python 基础依赖
COPY requirements-base.txt requirements.txt ./
RUN pip install --no-cache-dir \
-i https://mirrors.aliyun.com/pypi/simple/ \
--trusted-host mirrors.aliyun.com \
-r requirements-base.txt -r requirements.txt
# 虚拟环境瘦身
RUN find /opt/venv -name "*.so" -type f -exec strip --strip-all {} \; 2>/dev/null || true
RUN find /opt/venv -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null; \
find /opt/venv -name "*.pyc" -delete 2>/dev/null || true
# 清理临时文件
RUN rm -f /tmp/requirements-base.txt /tmp/requirements.txt
ENV PYTHONPATH=/app
# Rebuild trigger: ACR push retry 20260826