mirror of
https://github.com/TheSmallHanCat/flow2api.git
synced 2026-05-06 22:13:48 +08:00
- Add helper function to detect headless/Docker environments in main.py - Implement auto-downgrade from personal to browser captcha mode in headless environments - Show warning messages when switching modes automatically - Update FlowClient to accept database instance for captcha configuration config: update default server port and enable proxy by default - Change default server port from 8000 to 18282 in config/setting.toml - Enable proxy by default with localhost:7897 URL - Update Docker and docker-compose configurations to use port 38000 for API build: add China mirror sources for faster dependency installation - Configure Debian apt to use Tsinghua University mirrors - Set PyPI to use Tsinghua University index with trusted host - Configure Playwright to download from npmmirror for faster installation chore: update gitignore to exclude data and config files - Add data directory to .gitignore - Exclude config/setting.toml and config/setting_warp.toml from version control docs: update docker-compose configurations for new port mappings - Change exposed port from 8000 to 38000 in docker-compose.yml - Update proxy service port from 1080 to 31080 in docker-compose.proxy.yml - Ensure proper volume mapping for Cloudflare WARP data persistence
45 lines
1.1 KiB
Docker
45 lines
1.1 KiB
Docker
FROM python:3.11-slim
|
||
|
||
WORKDIR /app
|
||
|
||
# 使用清华镜像源加速 apt (Debian bookworm)
|
||
RUN sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources \
|
||
&& sed -i 's|security.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources
|
||
|
||
# 安装 Playwright 所需的系统依赖
|
||
RUN apt-get update && apt-get install -y \
|
||
libnss3 \
|
||
libnspr4 \
|
||
libatk1.0-0 \
|
||
libatk-bridge2.0-0 \
|
||
libcups2 \
|
||
libdrm2 \
|
||
libxkbcommon0 \
|
||
libxcomposite1 \
|
||
libxdamage1 \
|
||
libxfixes3 \
|
||
libxrandr2 \
|
||
libgbm1 \
|
||
libasound2 \
|
||
libpango-1.0-0 \
|
||
libcairo2 \
|
||
&& rm -rf /var/lib/apt/lists/*
|
||
|
||
# 安装 Python 依赖(使用清华 PyPI 镜像)
|
||
COPY requirements.txt .
|
||
RUN pip install --no-cache-dir -r requirements.txt \
|
||
-i https://pypi.tuna.tsinghua.edu.cn/simple/ \
|
||
--trusted-host pypi.tuna.tsinghua.edu.cn
|
||
|
||
# 设置 Playwright 下载镜像(使用 npmmirror)
|
||
ENV PLAYWRIGHT_DOWNLOAD_HOST=https://registry.npmmirror.com/-/binary/playwright
|
||
|
||
# 安装 Playwright 浏览器
|
||
RUN playwright install chromium
|
||
|
||
COPY . .
|
||
|
||
EXPOSE 8000
|
||
|
||
CMD ["python", "main.py"]
|