Files
flow2api/Dockerfile.headed

33 lines
885 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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"]