|
FROM docker.io/library/python:3.10@sha256:e2c7fb05741c735679b26eda7dd34575151079f8c615875fbefe401972b14d85 |
|
RUN apt-get update && \ |
|
apt-get install -y --no-install-recommends fakeroot && \ |
|
mv /usr/bin/apt-get /usr/bin/.apt-get && \ |
|
echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get && \ |
|
chmod +x /usr/bin/apt-get && \ |
|
rm -rf /var/lib/apt/lists/* && \ |
|
useradd -m -u 1000 user |
|
|
|
|
|
RUN apt-get update && \ |
|
apt-get install -y --no-install-recommends \ |
|
git \ |
|
git-lfs \ |
|
ffmpeg \ |
|
libsm6 \ |
|
libxext6 \ |
|
cmake \ |
|
rsync \ |
|
libgl1-mesa-glx \ |
|
espeak-ng \ |
|
&& rm -rf /var/lib/apt/lists/* \ |
|
&& git lfs install |
|
|
|
|
|
RUN apt-get update && \ |
|
apt-get install -y --no-install-recommends curl && \ |
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ |
|
apt-get install -y --no-install-recommends nodejs && \ |
|
rm -rf /var/lib/apt/lists/* && apt-get clean |
|
|
|
|
|
USER user |
|
ENV PATH="/home/user/bin:${PATH}" |
|
|
|
|
|
|
|
RUN mkdir /home/user/app |
|
WORKDIR /home/user/app |
|
|
|
|
|
COPY --chown=user:user . /home/user/app |
|
|
|
|
|
RUN pip install --no-cache-dir pip -U |
|
RUN pip install --no-cache-dir \ |
|
datasets \ |
|
"huggingface-hub>=0.19" "hf_xet>=1.0.0,<2.0.0" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0" |
|
|
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
RUN pip install --no-cache-dir \ |
|
gradio[oauth]==5.26.0 \ |
|
"uvicorn>=0.14.0" \ |
|
spaces |
|
|
|
USER root |
|
|
|
|
|
RUN curl https://ollama.com/install.sh | sh |
|
|
|
USER user |
|
|
|
|
|
RUN pip freeze > /tmp/freeze.txt |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
COPY . . |
|
|
|
COPY . /home/user/app/ |
|
|
|
COPY . /app |
|
|
|
COPY app.py /home/user/app/app.py |
|
|
|
|
|
|
|
CMD ["python", "app.py"] |