Files
podx/app/Dockerfile

41 lines
1.3 KiB
Docker

## 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 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
# sensible defaults (can be overridden by .env)
WHISPER_MODEL=large-v3 \
WHISPER_PRECISION=int8
# 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 \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Upgrade pip toolchain then install Python deps
COPY requirements.txt .
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 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"]