apizai2 / Dockerfile
dragg2's picture
Update Dockerfile
a9b4d1c verified
raw
history blame contribute delete
583 Bytes
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"]