FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 RUN useradd -m -u 1000 user # Set home to the user's home directory ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ DEBIAN_FRONTEND=noninteractive \ STREAMLIT_WATCHER_TYPE=none # Install dependencies RUN apt-get update && apt-get install -y \ python3.10 \ python3-pip \ git \ texlive-latex-base \ texlive-latex-extra \ texlive-fonts-recommended \ texlive-latex-recommended \ latexmk \ poppler-utils \ && rm -rf /var/lib/apt/lists/* # Copy the files WORKDIR $HOME/app COPY --chown=user ./requirements.txt requirements.txt RUN pip install --upgrade pip \ && pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.0.6/flash_attn-2.6.3+cu124torch2.6-cp310-cp310-linux_x86_64.whl COPY --chown=user . $HOME/app USER user EXPOSE 7860 # Default command ENTRYPOINT ["streamlit", "run", "app.py", \ "--server.port=7860", \ "--server.address=0.0.0.0", \ "--server.enableXsrfProtection=false", \ "--server.enableCORS=false", \ "--server.headless=true"]