# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
FROM python:3.11
RUN useradd -m -u 1000 user

# TTS相关功能
RUN apt update && apt install ffmpeg -y


USER user


# 进入工作路径(必要)
WORKDIR /gpt


RUN git clone https://github.com/binary-husky/gpt_academic.git
WORKDIR /gpt/gpt_academic

COPY --chown=user:user ./config_private.py /gpt/gpt_academic/config_private.py
COPY --chown=user:user ./replace.py /gpt/gpt_academic/replace.py
RUN python3 replace.py


# 装载项目文件,安装剩余依赖(必要)
RUN pip3 install -r requirements.txt

ENV WEB_PORT 7860

# 启动(必要)
CMD ["python3", "-u", "main.py"]