File size: 1,255 Bytes
d1fd369
d2d75a3
d1fd369
d2d75a3
d1fd369
d2d75a3
d1fd369
d2d75a3
d1fd369
d2d75a3
d1fd369
d2d75a3
d1fd369
 
 
 
 
d2d75a3
d1fd369
 
 
 
 
 
 
 
 
 
 
d2d75a3
 
 
d1fd369
d2d75a3
d1fd369
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
32
33
34
35
36
FROM docker.io/library/python:3.10

RUN useradd -m -u 1000 user

WORKDIR /home/user/app

RUN pip install --no-cache-dir pip==22.3.1 && pip install --no-cache-dir datasets "huggingface-hub>=0.19" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0" streamlit==1.29.0 "uvicorn>=0.14.0" spaces==0.18.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

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

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 .pre-requirements.txt ]; then \
    pip install --no-cache-dir -r ./pre-requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple; \
else \
    echo "pre-requirements.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 8501

ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]