More fixes

This commit is contained in:
2025-09-07 12:29:18 +02:00
parent 5e2d1d20ab
commit b2ce0459af

View File

@@ -1,5 +1,11 @@
FROM python:3.11-slim FROM python:3.11-slim
# Keep python fast and quiet, and pip lean
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
# System deps (ffmpeg for media, jq for scripts, poppler-utils for PDFs, curl for healthcheck)
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \ ffmpeg \
curl \ curl \
@@ -8,11 +14,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
WORKDIR /app WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Upgrade pip first, then install deps
COPY requirements.txt .
RUN python -m pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt \
&& pip check || true
# App code
COPY app.py worker.py ./ COPY app.py worker.py ./
RUN pip install --no-cache-dir gunicorn==22.0.0 RUN pip install --no-cache-dir gunicorn==22.0.0
# Basic container health check (relies on curl)
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD curl -fsS http://127.0.0.1:8080/ || exit 1
EXPOSE 8080 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"]