Adding GPU support for transcription

This commit is contained in:
2025-10-05 12:01:22 +02:00
parent 51624bd066
commit a450ab5c70
5 changed files with 82 additions and 14 deletions

View File

@@ -1,4 +1,7 @@
FROM python:3.11-slim
## GPU-ready base image with CUDA 12 + cuDNN 9 runtime
# If you don't have an NVIDIA GPU or the NVIDIA Container Toolkit, this image still runs on CPU.
# For smaller CPU-only images, you can switch back to python:3.11-slim.
FROM nvidia/cuda:12.4.1-cudnn9-runtime-ubuntu22.04
# Keep python fast/quiet and pip lean
ENV PYTHONDONTWRITEBYTECODE=1 \
@@ -12,6 +15,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
# System deps: ffmpeg for media, curl for healthcheck, jq for scripts, poppler-utils for PDFs
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 python3-pip python3-venv \
ffmpeg \
curl \
jq \
@@ -22,15 +26,15 @@ WORKDIR /app
# Upgrade pip toolchain then install Python deps
COPY requirements.txt .
RUN python -m pip install --upgrade pip setuptools wheel \
&& pip install --no-cache-dir -r requirements.txt \
&& pip check || true
RUN python3 -m pip install --upgrade pip setuptools wheel \
&& pip3 install --no-cache-dir -r requirements.txt \
&& pip3 check || true
# App code
COPY app.py worker.py scanner.py ./
RUN pip install --no-cache-dir gunicorn==22.0.0
RUN pip3 install --no-cache-dir gunicorn==22.0.0
# Healthcheck against the app's /health endpoint
EXPOSE 8080
CMD ["gunicorn", "-b", "0.0.0.0:8080", "app:app", "--workers", "2", "--threads", "4"]
CMD ["gunicorn", "-b", "0.0.0.0:8080", "app:app", "--workers", "2", "--threads", "4"]