File size: 1,006 Bytes
1e84411
 
 
 
 
 
 
 
 
 
 
 
 
fa1140b
1e84411
fa1140b
 
1e84411
 
 
839deab
 
1e84411
 
 
 
 
839deab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# anuma2api — Hugging Face Space Docker
# 用法:Space 的 Docker 模板 + 本项目 hf_space/ 目录(含本文件、init_and_run.sh、README.md)
# 持久化:启用 Space Persistent Storage(挂载点 /data),config/账号/日志存那里。
FROM python:3.12-slim

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/

WORKDIR /app

# 依赖(利用层缓存)
COPY pyproject.toml ./
RUN uv sync --no-dev --no-install-project

# 业务代码(网关本体 + 注册机(可选) + 静态面板)
COPY app ./app
COPY registrar ./registrar
COPY scripts ./scripts
# 种子配置与示例账号(首启由 init_and_run.sh 拷入 /data 持久目录)
COPY config.toml ./config.toml
COPY account ./account
# 启动脚本(ENTRYPOINT 用;放在容器根工作目录,与上面 COPY 的源同层)
COPY init_and_run.sh ./init_and_run.sh

# HF Space:持久存储默认挂 /data;$PORT 由 HF 注入
ENV HF_DATA_DIR=/data

EXPOSE 7860
ENTRYPOINT ["bash", "/app/init_and_run.sh"]