diff --git a/CLAUDE.md b/CLAUDE.md index 3dfe7f3..02dca2e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -264,8 +264,10 @@ container before stopping the old one (rolling update) and both share answers. Only SIGTERM flips it, not the marker drain: at that point the new container is still booting and nobody else would be routable. The Coolify app has its health check enabled on that path so it waits for the new - container to be `healthy` before stopping the old one. `/health` stays a - plain liveness probe for the external watcher. + container to be `healthy` before stopping the old one. With that option on, + Coolify replaces the Dockerfile HEALTHCHECK with its own curl/wget command, + so the image must ship `curl` or every deploy rolls back as unhealthy. + `/health` stays a plain liveness probe for the external watcher. - `/api/status` answers from disk for a job this instance never held, so a poll landing on either container during the handover is fine. - `main.py` leaves `.transcript_checkpoint.json` in the job dir so a job that diff --git a/Dockerfile b/Dockerfile index 9aa6144..80b05b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,6 +40,7 @@ WORKDIR /app # fonts libass falls back to DejaVu for every UI option (issue #57). RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg \ + curl \ libgl1 \ libglib2.0-0 \ libsm6 \ @@ -122,8 +123,11 @@ EXPOSE 8000 # it answers and an instance that received SIGTERM (503 from /health/ready) # is dropped within interval*retries, while its socket is still open. Coolify's # rolling update also waits on this before stopping the old container. The -# app is up in ~3 s; start-period covers slow disks. No curl in the image. +# app is up in ~3 s; start-period covers slow disks. curl is installed above +# for this: when the Coolify health check is enabled it replaces this +# HEALTHCHECK with its own curl/wget command, and an image without either +# reports unhealthy forever and every deploy rolls back (2026-08-25). HEALTHCHECK --interval=5s --timeout=3s --start-period=30s --retries=2 \ - CMD ["python3", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/health/ready', timeout=2).status == 200 else 1)"] + CMD curl -sf http://127.0.0.1:8000/health/ready > /dev/null || exit 1 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--proxy-headers", "--forwarded-allow-ips", "*", "--timeout-graceful-shutdown", "15"]