2023-03-28 11:09:31 +08:00
|
|
|
# please visit https://github.com/xfyun/aiges/releases to get stable and suitable iamges.
|
|
|
|
|
2023-03-28 16:24:55 +08:00
|
|
|
FROM docker.io/library/python:3.8.9
|
2023-03-28 11:09:31 +08:00
|
|
|
|
2023-03-28 15:09:09 +08:00
|
|
|
RUN apt-get install -y unzip
|
|
|
|
|
|
|
|
|
2023-03-28 17:40:01 +08:00
|
|
|
RUN sed -i 's http://deb.debian.org http://mirrors.ustc.edu.cn g' /etc/apt/sources.list
|
|
|
|
RUN sed -i '/security/d' /etc/apt/sources.list
|
2023-03-28 15:09:09 +08:00
|
|
|
|
2023-03-28 17:40:01 +08:00
|
|
|
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/*
|
2023-03-28 11:09:31 +08:00
|
|
|
|
2023-03-28 11:27:24 +08:00
|
|
|
|
2023-03-28 16:24:55 +08:00
|
|
|
WORKDIR /home/user/app
|
|
|
|
RUN useradd -m -u 1000 user
|
|
|
|
RUN chown -R 1000.1000 /home/user
|
2023-03-28 11:09:31 +08:00
|
|
|
|
2023-03-28 16:24:55 +08:00
|
|
|
RUN mkdir /home/user/app/hub/
|
|
|
|
RUN mkdir /home/user/app/hub/checkpoints
|
2023-03-28 11:09:31 +08:00
|
|
|
|
2023-03-28 16:24:55 +08:00
|
|
|
|
|
|
|
RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple/
|
|
|
|
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir gradio==3.0.9
|
|
|
|
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
|
|
|
|
|
|
|
|
|
2023-03-28 17:40:01 +08:00
|
|
|
COPY --chown=1000 ./ /home/user/app
|
2023-03-28 16:24:55 +08:00
|
|
|
|
2023-03-28 17:40:01 +08:00
|
|
|
COPY --chown=1000 hub/checkpoints /root/.cache/torch/hub/checkpoints
|
2023-03-28 16:24:55 +08:00
|
|
|
|
2023-03-28 17:40:01 +08:00
|
|
|
CMD ["python3", "app.py"]
|
2023-03-28 11:09:31 +08:00
|
|
|
|
2023-03-28 17:40:01 +08:00
|
|
|
|
|
|
|
export COMPOSE_DOCKER_CLI_BUILD=1
|