Julien Calixte 516daf0b07 fix: attach couchdb to coolify external network for Traefik routing
The container was only on the project's default network, so Coolify's
Traefik (on the shared coolify network) had no route to it — Traefik
matched the router but reported "no available server". Putting couchdb
on both networks lets Traefik reach 5984 while leaving the init sidecar
talking to it over the default network as before.
2026-06-01 20:52:40 +02:00
2026-06-01 20:37:14 +02:00

coolcouch

CouchDB 3 on Coolify. The couchdb-init sidecar waits for the server to come up, creates the three system databases, and enables CORS via the config API — no file mounts required.

Deploy

  1. In Coolify: New Resource → Docker Compose and point it at this repository.
  2. In the resource's Environment Variables tab, set:
    • COUCHDB_PASSWORD — required
    • COUCHDB_USER — optional, defaults to admin
  3. In the resource's Domains tab, assign a domain to the couchdb service on port 5984. Coolify fills SERVICE_FQDN_COUCHDB_5984 from this.
  4. Deploy. couchdb-init runs once, exits, and won't restart.

Verify

Replace $DOMAIN and $PASS:

curl -fsS https://$DOMAIN/_up
curl -fsS -u admin:$PASS https://$DOMAIN/
curl -fsS -u admin:$PASS https://$DOMAIN/_all_dbs
curl -fsS -I -X OPTIONS https://$DOMAIN/ \
  -H "Origin: https://example.com" \
  -H "Access-Control-Request-Method: GET"

Expected: _up returns {"status":"ok",...}; / returns the CouchDB welcome JSON; _all_dbs returns ["_global_changes","_replicator","_users"]; the preflight returns 2xx with an Access-Control-Allow-Origin header.

If the init logs show CORS errors, you can re-trigger only that step by redeploying — the PUTs against /_node/_local/_config/... are idempotent.

CORS

Wildcard origin (*) with credentials = false — the only browser-spec-legal combination with a wildcard. For credentialed auth from the browser, edit the put_config cors origins/credentials lines in docker-compose.yml.

Files

  • docker-compose.yml — services, volume, Traefik labels, init sidecar
Description
No description provided
Readme 71 KiB
Languages
Gleam 94%
Dockerfile 6%