Spaces:
Sleeping
Sleeping
| # 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 \ | |
| libgomp1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements file first (layer caching) | |
| COPY requirements.txt . | |
| # Install Python dependencies (this layer will be cached) | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy model file (this rarely changes) | |
| # COPY model.keras . | |
| # Copy application code last (this changes frequently) | |
| COPY app.py . | |
| # Expose port | |
| EXPOSE 7860 | |
| # Run the application | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |