2.9 KiB
2.9 KiB
Deploying log-proxy via Coolify
Coolify v4 — Docker Compose service backed by this Forgejo repo.
Prereqs
- The Forgejo repo
https://repo.rahamafresh.com/kianiadee/dozzle_n8n_loggingis public (already true). - The target n8n container
n8n-o55elukmxacgp1s2xcwktyamis running (already true). - The Docker network
o55elukmxacgp1s2xcwktyamexists on the host (auto-created by Coolify when n8n was deployed).
One-time setup in Coolify UI
- New Resource → pick the same project as the n8n service (or any project; visibility-only).
- Source type: Public Repository.
- Repository URL:
https://repo.rahamafresh.com/kianiadee/dozzle_n8n_logging - Branch:
main - Build pack: Docker Compose
- Docker Compose file location:
/coolify/log-proxy.compose.yml - Domains: leave empty (internal-only service; no Traefik route).
- Deploy.
What Coolify will do
- Clone the repo into its build workspace.
- Run
docker compose -f coolify/log-proxy.compose.yml build— builds the image fromlog-proxy/Dockerfile. - Run
docker compose -f coolify/log-proxy.compose.yml up -d— starts the container. - The
n8n_netexternal network reference resolves too55elukmxacgp1s2xcwktyam, joining log-proxy to the n8n service network with aliaslog-proxy.
Verifying
From the host:
# 1. Container is up and healthy
docker ps --filter 'name=log-proxy' --format 'table {{.Names}}\t{{.Status}}'
# 2. n8n can reach it
docker exec n8n-o55elukmxacgp1s2xcwktyam wget -qO- http://log-proxy:8080/healthz
# Expected: {"ok":true}
# 3. /services returns all allow-listed groups
docker exec n8n-o55elukmxacgp1s2xcwktyam wget -qO- http://log-proxy:8080/services | head -c 600
# 4. Logs since 5 minutes ago for tracksolid
docker exec n8n-o55elukmxacgp1s2xcwktyam sh -c 'wget -qO- "http://log-proxy:8080/logs/tracksolid?since=$(date -d "5 minutes ago" +%s)"' | head -c 500
Negative checks (these MUST fail — proves the proxy is read-only):
# Any non-allow-listed UUID → 404
docker exec n8n-o55elukmxacgp1s2xcwktyam wget -qO- http://log-proxy:8080/logs/garage 2>&1 | head -c 200
# Expected: 404 / "Unknown group"
# No mutating endpoints
docker exec n8n-o55elukmxacgp1s2xcwktyam wget -qO- --method=POST http://log-proxy:8080/services 2>&1 | head -c 200
# Expected: 405 / Method Not Allowed
Redeploying after a change
Any change to log-proxy/* or coolify/log-proxy.compose.yml:
- Commit + push to
main. - In Coolify UI: open the log-proxy resource → Redeploy.
A webhook-based auto-deploy can be configured later (Coolify → resource → Webhook → register URL on the Forgejo repo).
Updating groups.yml
groups.yml is baked into the image (not a mount). To add or remove a monitored service:
- Edit
log-proxy/groups.yml. - Commit + push.
- Redeploy (image rebuilds, container restarts).
- Clone an n8n Poll workflow for any new group.