aca / Dockerfile
yetey's picture
Update Dockerfile
e572b72
# 使用更具体的基础镜像标签,例如 python:3.11-slim,可以减小镜像大小。
FROM python:3.11-slim
# 更新 pip 并安装依赖项。
RUN apt-get update \
&& apt-get install -y --no-install-recommends git \
&& pip install --no-cache-dir --upgrade pip
# 克隆项目仓库。
RUN git clone https://github.com/binary-husky/gpt_academic
# 设置工作目录。
WORKDIR /gpt_academic
# 创建所需目录并设置权限。
RUN mkdir -p /.cache /gpt_academic/gpt_log /gpt_academic/private_upload \
&& chmod 777 /.cache /gpt_academic/gpt_log /gpt_academic/private_upload
# 安装 Python 依赖。
RUN pip install -r requirements.txt \
&& pip install --upgrade nougat-ocr tiktoken
# 设置环境变量。
ENV MPLCONFIGDIR=/gpt_academic/.matplotlib \
WEB_PORT=7860 \
DEFAULT_WORKER_NUM=3 \
THEME="Chuanhu-Small-and-Beautiful" \
DARK_MODE=False \
TIMEOUT_SECONDS=10 \
MAX_RETRY=3 \
LLM_MODEL="gpt-3.5-turbo"
# 创建 matplotlib 配置目录。
RUN mkdir -p $MPLCONFIGDIR && chmod 777 $MPLCONFIGDIR
# 暴露端口。
EXPOSE 7860
# 设置容器启动命令。
CMD ["python3", "-u", "main.py"]