feat: ShootTracker SQLite+JWT+YOLOv8
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# ─── ShootTracker AI Service ──────────────────────────────────────────────────
|
||||
# Python + FastAPI + YOLOv8 + OpenCV
|
||||
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Dépendances système pour OpenCV
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libglib2.0-0 \
|
||||
libsm6 \
|
||||
libxext6 \
|
||||
libxrender-dev \
|
||||
libgl1-mesa-glx \
|
||||
libgomp1 \
|
||||
wget \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copier et installer les dépendances Python
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Pré-télécharger le modèle YOLOv8n (pour éviter le téléchargement au premier démarrage)
|
||||
RUN python -c "from ultralytics import YOLO; YOLO('yolov8n.pt')" || echo "Download YOLOv8n on first run"
|
||||
|
||||
# Copier le code
|
||||
COPY . .
|
||||
|
||||
# Variables d'environnement
|
||||
ENV PORT=8000
|
||||
ENV YOLO_MODEL_PATH=yolov8n.pt
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
# Healthcheck
|
||||
HEALTHCHECK --interval=30s --timeout=15s --start-period=60s --retries=3 \
|
||||
CMD wget -qO- http://localhost:8000/health || exit 1
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]
|
||||
Reference in New Issue
Block a user