forked from ZRainbow1275/AutoTeam-F
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (30 loc) · 876 Bytes
/
Copy pathDockerfile
File metadata and controls
41 lines (30 loc) · 876 Bytes
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
FROM python:3.12-slim
# 系统依赖
RUN apt-get update && apt-get install -y --no-install-recommends \
xvfb \
curl \
fonts-noto-cjk \
&& rm -rf /var/lib/apt/lists/*
# 安装 uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:$PATH"
WORKDIR /app
# 复制项目文件
COPY pyproject.toml uv.lock ./
RUN uv sync --no-dev
# 安装 Playwright 浏览器
RUN uv run playwright install chromium && uv run playwright install-deps chromium
# 复制源码
COPY src/ src/
COPY web/ web/
# 数据卷(.env、accounts.json、auths/、state.json、screenshots/)
VOLUME ["/app/data"]
# 启动时将数据目录软链到工作目录
RUN mkdir -p /app/data
ENV DISPLAY=:99
EXPOSE 8787
# 启动脚本
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["api"]