Livrare LOT 1 - Didi
This commit is contained in:
commit
5380c3fc63
990 changed files with 133308 additions and 0 deletions
41
ai_platform/modules/video-analysis/deploy/Dockerfile
Normal file
41
ai_platform/modules/video-analysis/deploy/Dockerfile
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# Video Analysis API Server
|
||||
# Multi-stage build for smaller final image
|
||||
|
||||
FROM python:3.11.12-slim AS builder
|
||||
|
||||
# Install uv
|
||||
COPY --from=ghcr.io/astral-sh/uv:0.10 /uv /usr/local/bin/uv
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy project files
|
||||
COPY pyproject.toml uv.lock README.md ./
|
||||
COPY src/ ./src/
|
||||
|
||||
# Install dependencies (allow resolving to pick up new deps)
|
||||
RUN uv sync --no-dev
|
||||
|
||||
# Production image
|
||||
FROM python:3.11.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy virtual environment from builder
|
||||
COPY --from=builder /app/.venv /app/.venv
|
||||
|
||||
# Copy source code
|
||||
COPY src/ ./src/
|
||||
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV VIDEO_ANALYSIS_PORT=54600
|
||||
|
||||
# Health check (python urllib; no curl in slim)
|
||||
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
|
||||
CMD python -c "import urllib.request; import os; urllib.request.urlopen(f'http://localhost:{os.environ.get(\"VIDEO_ANALYSIS_PORT\", 54600)}/health')" || exit 1
|
||||
|
||||
EXPOSE 54600
|
||||
|
||||
CMD uvicorn video_analysis.app:app --host 0.0.0.0 --port ${VIDEO_ANALYSIS_PORT}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue