docs icon indicating copy to clipboard operation
docs copied to clipboard

Add Health Check Example for Self-Hosted Directus in Docker

Open podlomar opened this issue 11 months ago • 5 comments

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.

podlomar avatar Feb 05 '25 20:02 podlomar