Coolify production deploy, configuration, and healthchecks #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Production Coolify deploy + configuration for the research API and weekly worker, including healthchecks (
/health,/ready) so Coolify and reverse proxies can restart/unhealthy-route correctly.Gap:
gaps/GAP_1788152435.md§2 (no Dockerfile, compose is DB-only). Pattern reference:voting/deploy/coolify.env.example.Posts API issue owns route shapes; this issue owns how they run in Coolify.
Current codebase
docker-compose.yml: Postgres/pgvector only (host 5433).deploy/, no Coolify service spec, no systemd.weekly-dry-runis GitLab schedule on fixtures — not production collect.week,ingest,search,fetch,migrate). No long-running HTTP server yet (posts API issue)..env.examplelists secrets but nothing loads.env(dotenvmissing).Why this is needed
Operators cannot place this on Coolify next to other CL8Y services. Without healthchecks, a hung worker or dead DB still looks “up.” The posts API must be independently restartable from the cron-like week job.
Constraints / guardrails
.envgitignored.api(HTTP) andworker(scheduledweek/ ingest). Shared Postgres.0.0.0.0; documentAPI_BIND. Do not expose Postgres publicly./health= process alive (no secret leak in body)./ready= DB ping + optional migrations applied. Coolify should use/readyfor the API.cl8y-research week ....https://cl8y.com.Relevant files
docker-compose.yml.env.example.gitlab-ci.ymlsrc/main.rsREADME.mdvoting/deploy/coolify.env.exampleAdd:
Dockerfile,deploy/coolify.env.example,deploy/README.md(Coolify click-path: image, ports, healthcheck URL, cron, Postgres addon), compose override for api+worker+db.Recommended direction
cargo build --release --features postgres(and server feature).CMDdefault API; worker service overrides tocl8y-research week ...orworkersubcommand that loops/cron.{"ok":true}/ ready checksSELECT 1)..env.example+PUBLIC_ORIGIN,API_BIND,TAVILY_API_KEY, telegram private chat id, replicate models.docker compose --profile prod up(ordeploy/docker-compose.coolify.yml) for smoke.Acceptance criteria
GET /health200 without DB.GET /ready200 with DB; 503 if DB down (no stack traces / DSNs in body)./ready.deploy/coolify.env.examplelists all production vars with comments; no real secrets.week --dry-runin container against fixtures without live tokens.Test plan — functional paths
DATABASE_URL; ready 200 after migrate.docker build(or documented local).curl /health/ready/v1/posts(if API issue merged) or 404 until then.--dry-runexits 0 in image.Test plan — attack, hack, and abuse
/ready503 body has nopostgres://password.POST /run-weekexists, it must be authn; default is no such route.USER rootat runtime.REPLICATE_API_TOKEN.Verification criteria
deploy/README.mdagainst a throwaway Coolify (or compose) and sees/readygreen./readyto 503;/healthstays 200.marked as related to #2