FROM python:3.9-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ libgl1 \ && rm -rf /var/lib/apt/lists/* # Create cache directory RUN mkdir -p /cache && chmod -R 777 /cache # Copy requirements first for better caching COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application files COPY src/ ./src/ # Set environment variables ENV TRANSFORMERS_CACHE=/cache ENV STREAMLIT_SERVER_PORT=8501 ENV STREAMLIT_SERVER_MAX_UPLOAD_SIZE=10 EXPOSE 8501 CMD ["streamlit", "run", "src/streamlit_app.py", \ "--server.port=8501", \ "--server.address=0.0.0.0", \ "--server.maxUploadSize=10", \ "--server.enableXsrfProtection=false", \ "--server.enableCORS=false"]