docs
docs copied to clipboard
Add Health Check Example for Self-Hosted Directus in Docker
Describe the Request
When self-hosting a Directus instance using Docker, it's common to have another container running on top of Directus as part of a larger application stack. This app container often needs to wait until Directus is fully up and ready before starting.
A working health check that I use looks like this:
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://directus:8055/server/health"]
interval: 10s
timeout: 5s
retries: 5
start_interval: 5s
start_period: 30s
I suggest adding this example to the Directus documentation to help others avoid the trial-and-error process of figuring out a proper health check setup.
Maintenance Strategy
Unlikely to require frequent maintenance as long as the health API endpoint stays the same and the directus container contains wget by default.