Spaces:
Paused
Paused
Download Dockerfile from zyd123/airProxyPool: direct link, hf CLI and curl.
- Browser
- Download file 1.94 kB
-
https://huggingface.co/spaces/zyd123/airProxyPool/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/zyd123/airProxyPool/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/zyd123/airProxyPool/resolve/main/Dockerfile
1.94 kB
| # 使用官方 Python 镜像 (选择合适的版本,例如 3.9) | |
| FROM python:3.9-slim | |
| # 设置工作目录 | |
| WORKDIR /app | |
| # 安装必要的系统依赖 (git 用于子模块, wget/tar 用于 glider) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git \ | |
| wget \ | |
| ca-certificates \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # --- 安装 Glider --- | |
| ARG GLIDER_VERSION=0.16.3 | |
| ARG TARGETARCH=amd64 | |
| ARG GLIDER_ARCHIVE=glider_${GLIDER_VERSION}_linux_${TARGETARCH}.tar.gz | |
| ARG GLIDER_URL=https://github.com/nadoo/glider/releases/download/v${GLIDER_VERSION}/${GLIDER_ARCHIVE} | |
| RUN wget ${GLIDER_URL} \ | |
| && tar -zxf ${GLIDER_ARCHIVE} \ | |
| && mkdir -p /app/glider \ | |
| && mv glider_*/glider /app/glider/glider \ | |
| && chmod +x /app/glider/glider \ | |
| && rm ${GLIDER_ARCHIVE} \ | |
| && rm -rf glider_* | |
| # --- 安装 Python 依赖 --- | |
| # 复制合并后的 requirements 文件 | |
| COPY requirements.txt . | |
| # 安装 Python 包 | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # --- 复制项目文件 --- | |
| # 将你的应用代码和配置文件复制到容器中 | |
| # 这会包括 .gitmodules 文件和空的 aggregator 目录 | |
| COPY . . | |
| # --- 初始化子模块 --- | |
| # 在容器内初始化并拉取 aggregator 子模块的代码 | |
| RUN git submodule update --init --recursive | |
| # --- 创建 aggregator 数据目录和日志文件并设置权限 --- <--- 修改后的部分开始 | |
| RUN mkdir -p /app/aggregator/data && \ | |
| touch /app/aggregator/workflow.log && \ | |
| chmod -R 777 /app/aggregator/data /app/aggregator/workflow.log | |
| # --- 配置和运行 --- | |
| # 确保 glider.conf 被复制进来 (包含在上面的 COPY . . 中) | |
| # 暴露 Glider 监听的端口 (必须和 glider.conf 中的端口一致) | |
| EXPOSE 10707 | |
| # 定义容器启动时运行的命令 | |
| # 运行 scheduler.py (假设它会启动 glider 并管理代理池) | |
| CMD ["python", "scheduler.py"] | |