37 lines
1.1 KiB
Docker
37 lines
1.1 KiB
Docker
FROM python:3.11-slim
|
|
|
|
# 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 \
|
|
ffmpeg \
|
|
curl \
|
|
jq \
|
|
poppler-utils \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
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
|
|
|
|
# App code
|
|
COPY app.py worker.py ./
|
|
RUN pip install --no-cache-dir gunicorn==22.0.0
|
|
|
|
# Healthcheck against the app's /health endpoint
|
|
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD curl -fsS http://127.0.0.1:8080/health || exit 1
|
|
|
|
EXPOSE 8080
|
|
CMD ["gunicorn", "-b", "0.0.0.0:8080", "app:app", "--workers", "2", "--threads", "4"] |