mirror of
https://github.com/TheSmallHanCat/flow2api.git
synced 2026-05-08 06:49:25 +08:00
23 lines
655 B
Docker
23 lines
655 B
Docker
FROM python:3.11-slim
|
||
|
||
WORKDIR /app
|
||
|
||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||
PYTHONUNBUFFERED=1 \
|
||
ALLOW_DOCKER_HEADED_CAPTCHA=true \
|
||
PLAYWRIGHT_BROWSERS_PATH=0
|
||
|
||
# 在镜像构建阶段预装 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"]
|