Webhooks & Health Endpoints¶
When server.enabled: true is set in config.yaml, DockerWorks starts an HTTP server on server.listen (default 127.0.0.1:8080).
Health Endpoint¶
Returns 200 OK with JSON:
Webhook Endpoint¶
Triggers an asynchronous sync and deployment for {app} and returns 202 Accepted:
Authentication¶
If apps[].webhook.secret or server.webhook_secret is configured (app-level secret takes precedence), DockerWorks validates the request using any of the following methods:
- GitHub HMAC-SHA256:
X-Hub-Signature-256: sha256=<hex> - GitLab Secret Token:
X-Gitlab-Token: <secret> - Bearer Token:
Authorization: Bearer <secret>
GitHub Setup¶
- In your GitHub repository, open Settings > Webhooks > Add webhook.
- Set Payload URL to
https://your-domain.example/webhooks/{app}(proxied to DockerWorks). - Set Content type to
application/json. - Set Secret to your configured
webhook_secret.
Manual Trigger¶
Prometheus Metrics Endpoint¶
When server.enabled: true and server.metrics_enabled: true are set, DockerWorks exposes Prometheus metrics in text exposition format at:
Exported metrics:
- docker_works_deployments_total{app,trigger,status}
- docker_works_rollbacks_total{app}
- docker_works_poll_errors_total{app,watcher}
- docker_works_last_deploy_success{app}
- docker_works_last_deploy_timestamp_seconds{app}
- docker_works_last_deployment_duration_seconds{app}
Keep /metrics internal
If you reverse-proxy /webhooks/ to the public internet, only proxy /webhooks/ and scrape http://127.0.0.1:8080/metrics locally from Prometheus.