Spaces:
Paused
Paused
| # Dockerfile optimized for Hugging Face Spaces | |
| # Use Python 3.11 slim image as base | |
| FROM python:3.11-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| gcc \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements first for better caching | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY app/ ./app/ | |
| # Copy Streamlit app | |
| COPY streamlit_app.py . | |
| # Copy startup script | |
| COPY start-all.sh . | |
| RUN chmod +x start-all.sh | |
| # Create .streamlit directory for config | |
| RUN mkdir -p ~/.streamlit | |
| # Create streamlit config to disable telemetry | |
| RUN echo '[browser]\nserverAddress = "localhost"\n[client]\nshowErrorDetails = true\n[logger]\nlevel = "info"' > ~/.streamlit/config.toml | |
| # Expose ports | |
| # 7860: Streamlit (exposed by HF Spaces) | |
| # 8000: FastAPI (internal) | |
| EXPOSE 7860 8000 | |
| # Run both services using startup script | |
| CMD ["./start-all.sh"] | |