-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.dev
More file actions
49 lines (38 loc) · 1.32 KB
/
Dockerfile.dev
File metadata and controls
49 lines (38 loc) · 1.32 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Development Dockerfile
# Code is mounted via volumes for hot reload, not copied into image
FROM python:3.10-slim
WORKDIR /app
# 安装系统依赖
RUN apt-get update && apt-get install -y \
gcc \
g++ \
curl \
git \
libreoffice \
libreoffice-writer \
libreoffice-calc \
fonts-wqy-microhei \
fonts-wqy-zenhei \
&& rm -rf /var/lib/apt/lists/*
# 创建字体符号链接(RAG-Anything 期望的路径)
RUN mkdir -p /usr/share/fonts/wqy-microhei && \
ln -s /usr/share/fonts/truetype/wqy/wqy-microhei.ttc /usr/share/fonts/wqy-microhei/wqy-microhei.ttc
# 安装 uv
RUN pip install --no-cache-dir uv
# 复制依赖文件
COPY pyproject.toml uv.lock* ./
# 安装依赖(使用 BuildKit 缓存)
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync
# 代码通过 volume 挂载,不 COPY 到镜像
# main.py, src/, api/ 在 docker-compose.dev.yml 中挂载
# 创建必要的目录
RUN mkdir -p /app/rag_local_storage /app/output /app/logs
# 暴露端口
EXPOSE 8000
# 健康检查
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8000/ || exit 1
# 启动命令(热重载)
# 注意:实际命令在 docker-compose.dev.yml 中override
CMD ["uv", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]