Spaces:
Running on Zero
Running on Zero
| # syntax=docker/dockerfile:1 | |
| FROM python:3.11-slim AS base | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| PIP_DISABLE_PIP_VERSION_CHECK=1 | |
| WORKDIR /app | |
| # Install system dependencies (build-essential, curl) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Python requirements | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application source | |
| COPY backend /app/backend | |
| COPY models /app/models | |
| COPY uploads /app/uploads | |
| # Expose port | |
| EXPOSE 8000 | |
| # Healthcheck | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ | |
| CMD curl -f http://localhost:8000/api/v1/health || exit 1 | |
| # Run Uvicorn | |
| CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "8000"] | |