add HEALTHCHECK instruction to the Dockerfile (#1397)

Since Martin gives us `/health` endpoint we could use it by default in
the Dockerfile.

I've added extra info to the doc about
https://github.com/willfarrell/docker-autoheal but not sure if that's
ok. I can remove it.
This commit is contained in:
Kacper Golinski 2024-07-03 23:35:57 +02:00 committed by GitHub
parent d270e8fb42
commit 1a2e381043
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -4,4 +4,5 @@ ARG TARGETPLATFORM
LABEL org.opencontainers.image.description="Blazing fast and lightweight tile server with PostGIS, MBTiles, and PMTiles support"
COPY target_releases/$TARGETPLATFORM/* /usr/local/bin
HEALTHCHECK CMD wget --spider http://localhost:3000/health || exit 1
ENTRYPOINT ["/usr/local/bin/martin"]

View File

@ -40,3 +40,5 @@ docker compose up -d martin
```
By default, Martin will be available at [localhost:3000](http://localhost:3000/)
Official Docker image includes a `HEALTHCHECK` instruction which will be used by Docker Compose. Note that Compose won't restart unhealthy containers. To monitor and restart unhealthy containers you can use [Docker Autoheal](https://github.com/willfarrell/docker-autoheal).