CoolFace
Apppublic

SOaiJL/auto-rednote-api

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
Dockerfile41 linesDownload Raw Back to root
1# Auto-RedNote 服务 - Hugging Face Spaces Docker 镜像
2# 基于 Python 3.13 + Playwright (Chromium)
3FROM python:3.13-slim
4
5# 安装 Playwright 所需系统依赖
6RUN apt-get update && apt-get install -y --no-install-recommends \
7    libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 \
8    libcups2 libdrm2 libdbus-1-3 libxkbcommon0 \
9    libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
10    libgbm1 libpango-1.0-0 libcairo2 libasound2t64 \
11    fonts-noto-cjk \
12    && rm -rf /var/lib/apt/lists/*
13
14WORKDIR /app
15
16# 安装 Python 依赖
17COPY requirements.txt .
18RUN pip install --no-cache-dir -r requirements.txt
19
20# 安装 Playwright + Chromium
21RUN pip install --no-cache-dir playwright && \
22    playwright install --with-deps chromium
23
24# 复制技能脚本和 .so 文件
25COPY scripts/ ./scripts/
26
27# 复制资产文件(HTML模板 + 主题CSS)
28COPY assets/ ./assets/
29
30# 复制应用代码
31COPY app.py .
32
33# 创建输出目录
34RUN mkdir -p output
35
36# Hugging Face Spaces 要求监听 7860 端口
37EXPOSE 7860
38
39# 启动服务
40CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
41