FROM nvidia/cuda:12.1.0-base-ubuntu22.04 # Install system dependencies RUN apt-get update && apt-get install -y \ python3.10 \ python3-pip \ git \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Create cache directory RUN mkdir -p /.cache/huggingface && \ chmod -R 777 /.cache # Create Streamlit config directory RUN mkdir -p /app/.streamlit # Install chandra-ocr RUN pip3 install --no-cache-dir chandra-ocr # Expose port EXPOSE 7860 # Environment variables ENV STREAMLIT_SERVER_PORT=7860 ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0 ENV STREAMLIT_SERVER_HEADLESS=true ENV HF_HOME=/.cache/huggingface ENV TRANSFORMERS_CACHE=/.cache/huggingface ENV HF_DATASETS_CACHE=/.cache/huggingface # Copy Streamlit config (will be available from the repo) COPY .streamlit/config.toml /app/.streamlit/config.toml # Run the app CMD ["python3", "-m", "streamlit", "run", "/usr/local/lib/python3.10/dist-packages/chandra/scripts/app.py", "--server.port=7860", "--server.address=0.0.0.0"]