# please visit https://github.com/xfyun/aiges/releases to get stable and suitable iamges.

FROM iflyopensource/aiges-gpu:11.2-1.17-3.9.13-ubuntu1804-v3.3.2 

RUN sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list
RUN sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list

RUN --mount=target=/root/packages.txt,source=packages.txt  apt-get update && xargs -r -a /root/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*

WORKDIR /home/user/app
RUN useradd -m -u 1000 user
RUN chown  -R 1000.1000 /home/user


RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple/


RUN pip install --no-cache-dir pip==22.3.1
RUN --mount=target=requirements.txt,source=requirements.txt 	pip install --no-cache-dir -r requirements.txt

COPY --chown=1000 ./ /home/user/app

RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
RUN apt-get install git-lfs
RUN git lfs install
RUN git clone http://172.16.59.16:3000/microsoft/git-large-coco.git

CMD ["python3", "app.py"]
