docker-immich icon indicating copy to clipboard operation
docker-immich copied to clipboard

Healthcheck not usable since replacement of IMMICH_PORT and IMMICH_HOST

Open loeffelpan opened this issue 3 months ago • 2 comments

I would like to add a healthcheck to my container. Something similar has been tried in #485, but there is no more activity

The desired way to do that is immich-healthcheck inside the container. This script is maintained by the immich team and already part of your image. It does use IMMICH_PORT (defaults to 2283) and IMMICH_HOST (defaults to localhost) if set. Unfortunately it's not working due to a lack of IMMICH_PORT as default doesn't match your image. IMMICH_PORT/HOST have been replaced by SERVER_PORT/HOST recently.

Maybe the easiest approach would be to set IMMICH_PORT and IMMICH_HOST as a copy of SERVER_PORT and SERVER_HOST if given?

loeffelpan avatar Sep 28 '25 21:09 loeffelpan

a healthcheck can be achieved with (if using docker compose)

    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/ping"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 10s

hydazz avatar Oct 24 '25 12:10 hydazz

I'm using that already, but this is not precise. The original healthcheck from immich does a little bit more and checks the returncode AND the content of the response. See here.

Is there any problem adding those (original) environment variables to make healthcheck work as intended?

loeffelpan avatar Oct 24 '25 13:10 loeffelpan