-
Notifications
You must be signed in to change notification settings - Fork 530
Expand file tree
/
Copy pathDockerfile.headed
More file actions
32 lines (24 loc) · 885 Bytes
/
Dockerfile.headed
File metadata and controls
32 lines (24 loc) · 885 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
FROM python:3.11-slim
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
ALLOW_DOCKER_HEADED_CAPTCHA=true \
DISPLAY=:99 \
PERSONAL_BROWSER_HEADLESS=0 \
PLAYWRIGHT_BROWSERS_PATH=0
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
fluxbox \
x11-utils \
xauth \
xvfb \
&& rm -rf /var/lib/apt/lists/*
# 在镜像构建阶段预装 Playwright Chromium,供 personal/browser 模式复用
COPY requirements.txt ./
RUN pip install --no-cache-dir --root-user-action=ignore -r requirements.txt \
&& python -m playwright install --with-deps chromium
COPY . .
COPY docker/entrypoint.headed.sh /usr/local/bin/entrypoint.headed.sh
RUN sed -i 's/\r$//' /usr/local/bin/entrypoint.headed.sh && chmod +x /usr/local/bin/entrypoint.headed.sh
EXPOSE 8000
CMD ["/usr/local/bin/entrypoint.headed.sh"]