Spaces:
Sleeping
Sleeping
File size: 815 Bytes
a8b213d |
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 |
FROM python:3.11-slim
# set HF cache to /tmp for writable FS on Spaces
ENV HF_HOME=/tmp/huggingface
ENV TOKENIZERS_PARALLELISM=false
# install system packages needed by some python libs
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
wget \
libsndfile1 \
libgl1 \
libglib2.0-0 \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# copy requirements and install
COPY requirements.txt /app/requirements.txt
RUN pip install --upgrade pip
# try to be robust to wheels/build issues
# RUN pip wheel --no-cache-dir --wheel-dir=/wheels -r /app/requirements.txt || true
RUN pip install --no-cache-dir -r /app/requirements.txt
# copy app code
COPY . /app
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|