File size: 583 Bytes
1e283de a9b4d1c 1e283de 50f6a85 0091ca7 1e283de 0091ca7 1e283de |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
FROM python:3.12-slim
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# 克隆到 /app 内
RUN git clone https://github.com/ling-drag0n/zai-api.git .
RUN pip install --no-cache-dir -r requirements.txt
# 这一步在root用户下执行,确保数据文件被正确下载
RUN python -c "from browserforge.headers import HeaderGenerator; HeaderGenerator()" \
&& chmod -R 755 /usr/local/lib/python*/site-packages/browserforge/
RUN mkdir -p logs && chmod -R 777 /app
ENV LISTEN_PORT=7860
EXPOSE $LISTEN_PORT
CMD ["python", "main.py"]
|