|
FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04 |
|
|
|
ARG DEBIAN_FRONTEND=noninteractive |
|
|
|
RUN apt-get update && apt-get install --no-install-recommends -y \ |
|
build-essential \ |
|
ffmpeg \ |
|
python3-pip \ |
|
python3-dev \ |
|
python3-venv \ |
|
ninja-build \ |
|
libreoffice \ |
|
git \ |
|
unzip \ |
|
wget \ |
|
curl \ |
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* |
|
|
|
WORKDIR /data |
|
|
|
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y |
|
|
|
ENV VIRTUAL_ENV=/opt/venv |
|
|
|
RUN python3 -m venv $VIRTUAL_ENV |
|
ENV PATH="$VIRTUAL_ENV/bin:${PATH}" |
|
ENV PATH="/root/.cargo/bin:${PATH}" |
|
|
|
COPY ./requirements.txt /data/requirements.txt |
|
RUN pip3 install --no-cache-dir --upgrade -r /data/requirements.txt |
|
|
|
COPY pip.conf $VIRTUAL_ENV/pip.conf |
|
|
|
RUN pip3 install onnxruntime-gpu==1.17.1 |
|
|
|
RUN useradd -m -u 1000 user |
|
USER user |
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH \ |
|
PYTHONPATH=$HOME/app \ |
|
PYTHONUNBUFFERED=1 \ |
|
NVIDIA_VISIBLE_DEVICES=all \ |
|
NVIDIA_DRIVER_CAPABILITIES=compute,utility \ |
|
SYSTEM=spaces \ |
|
HF_HOME=$HOME/data \ |
|
OUTLINES_CACHE_DIR=$HOME/data \ |
|
NLTK_DATA=$HF_HOME \ |
|
TOKENIZERS_PARALLELISM=false \ |
|
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True |
|
|
|
WORKDIR $HOME/data |
|
|
|
COPY --chown=user . $HOME/data |
|
|
|
EXPOSE 8501 |
|
|
|
CMD streamlit run app.py \ |
|
--server.headless true \ |
|
--server.enableCORS false \ |
|
--server.enableXsrfProtection false \ |
|
--server.maxUploadSize 1000 \ |
|
--server.fileWatcherType watchdog \ |
|
--theme.backgroundColor "#EEE3D3" \ |
|
--theme.secondaryBackgroundColor "#CCC8C2" \ |
|
--theme.primaryColor "#EF792D" \ |
|
--theme.textColor "#7D6654" |