| FROM python:3.10-slim | |
| WORKDIR /app | |
| # System deps for OpenCV | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libgl1-mesa-glx libglib2.0-0 && \ | |
| rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt fastapi uvicorn python-multipart | |
| COPY . . | |
| # Health check for orchestrators (K8s, ECS, Docker Compose) | |
| HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ | |
| CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 1 | |
| EXPOSE 8000 | |
| # Run the REST API | |
| CMD ["uvicorn", "video_intelligence.api:app", "--host", "0.0.0.0", "--port", "8000"] | |