File size: 930 Bytes
19600fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4e4fd4c
19600fe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM docker.io/library/python:3.10

RUN apt-get update && apt-get install -y git git-lfs ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx && rm -rf /var/lib/apt/lists/* && git lfs install

RUN pip install --no-cache-dir pip==22.3.1 && pip install --no-cache-dir datasets "huggingface-hub>=0.12.1" "protobuf<4" "click<8.1" "pydantic~=1.0" gradio[oauth]==3.44.1 uvicorn>=0.14.0 spaces==0.18.0

WORKDIR /home/user/app

RUN useradd -m -u 1000 user

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

RUN if [ -f ./packages.txt ]; then \
    apt-get update && xargs -r -a ./packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*; \
else \
    echo "packages.txt not found!"; \
fi

RUN if [ -f ./requirements.txt ]; then \
    pip install --no-cache-dir -r ./requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple; \
else \
    echo "requirements.txt not found!"; \
fi

ENV PYTHONUNBUFFERED=1

EXPOSE 7860

ENTRYPOINT ["python", "app.py"]