|
|
|
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04 |
|
|
|
|
|
WORKDIR /DocQA |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
git \ |
|
python3.10 \ |
|
python3-pip \ |
|
poppler-utils \ |
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
USER user |
|
ENV HOME=/home/user |
|
ENV PATH=/home/user/.local/bin:/usr/local/cuda/bin:$PATH |
|
|
|
|
|
WORKDIR $HOME/app |
|
|
|
|
|
COPY --chown=user requirements.txt $HOME/app/ |
|
RUN pip install --no-cache-dir -r requirements.txt |
|
RUN pip uninstall --y faiss-cpu & pip install faiss-gpu |
|
RUN pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu124 |
|
|
|
|
|
COPY --chown=user . $HOME/app |
|
|
|
|
|
EXPOSE 8501 |
|
|
|
|
|
ENTRYPOINT ["streamlit", "run", "app.py", "--server.enableXsrfProtection", "false"] |
|
|
|
|