|
|
|
|
|
FROM python:3.10@sha256:ace6953906f89f6284daacd2c7addc351bf338629d89a8bb07f2a38bf38f301b |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir -U pip && \ |
|
|
pip install --no-cache-dir \ |
|
|
datasets \ |
|
|
"huggingface-hub==1.0.0rc6" \ |
|
|
"protobuf<4" \ |
|
|
"click<8.1" \ |
|
|
"pydantic==2.10.6" |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
git \ |
|
|
git-lfs \ |
|
|
ffmpeg \ |
|
|
libsm6 \ |
|
|
libxext6 \ |
|
|
cmake \ |
|
|
rsync \ |
|
|
libgl1 && \ |
|
|
rm -rf /var/lib/apt/lists/* && \ |
|
|
git lfs install |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y 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 curl && \ |
|
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ |
|
|
apt-get install -y nodejs && \ |
|
|
rm -rf /var/lib/apt/lists/* && \ |
|
|
apt-get clean |
|
|
|
|
|
|
|
|
WORKDIR /home/user/app |
|
|
|
|
|
|
|
|
COPY requirements.txt /tmp/requirements.txt |
|
|
RUN pip install --use-deprecated=legacy-resolver --no-cache-dir -r /tmp/requirements.txt |
|
|
|
|
|
|
|
|
COPY . /home/user/app |
|
|
EXPOSE 7860 |
|
|
|
|
|
RUN mkdir -p ./models |
|
|
RUN chmod -R 777 ./models |
|
|
RUN mkdir -p /home/user/app |
|
|
RUN chmod -R 777 /home/user/app |
|
|
|
|
|
|
|
|
USER root |
|
|
|
|
|
|
|
|
CMD ["python", "app_optimized.py"] |
|
|
|