From 80f21915e3f6413961cbd179313d50da3f4dedf7 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Thu, 16 Apr 2026 14:47:19 +0200 Subject: [PATCH] feat: switch to nvidia/cuda base image for NVENC hw encoding - Base: nvidia/cuda:12.6.3-runtime-ubuntu24.04 - ffmpeg from apt has NVENC support when GPU runtime is available - docker-compose reserves all GPUs via deploy.resources Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 11 ++++++++--- docker-compose.yml | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2d9fce7..d9c5ed7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,13 @@ -FROM python:3.12-slim -RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/* +FROM nvidia/cuda:12.6.3-runtime-ubuntu24.04 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3 python3-pip ffmpeg \ + && rm -rf /var/lib/apt/lists/* + WORKDIR /app COPY core/ core/ COPY server/ server/ -RUN pip install --no-cache-dir fastapi uvicorn[standard] +RUN pip install --no-cache-dir --break-system-packages fastapi uvicorn[standard] + EXPOSE 8000 CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "8000"] diff --git a/docker-compose.yml b/docker-compose.yml index bff2287..af816de 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,13 @@ services: EXPORT_DIR: /exports DB_PATH: /data/8cut.db CACHE_DIR: /data/cache + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: all + capabilities: [gpu] volumes: 8cut-data: