[GH-ISSUE #451] Healthcheck? #170

Closed
opened 2026-02-27 08:15:39 +03:00 by kerem · 6 comments
Owner

Originally created by @JaneJeon on GitHub (Feb 14, 2023).
Original GitHub issue: https://github.com/lldap/lldap/issues/451

Hello, I was wondering what is the best way to go about adding a Docker healthcheck for LLDAP.

Just wget/curl the admin site endpoint? Or is there a /healthz endpoint that I should be hitting instead?

Thank you.

Originally created by @JaneJeon on GitHub (Feb 14, 2023). Original GitHub issue: https://github.com/lldap/lldap/issues/451 Hello, I was wondering what is the best way to go about adding a Docker healthcheck for LLDAP. Just wget/curl the admin site endpoint? Or is there a /healthz endpoint that I should be hitting instead? Thank you.
kerem closed this issue 2026-02-27 08:15:39 +03:00
Author
Owner

@nitnelave commented on GitHub (Feb 14, 2023):

The CI docker image comes with a health check. Since there are several services to check, and the address depends on the config, it was simpler to implement in the app itself:

HEALTHCHECK CMD ["/app/lldap", "run", "--config-file", "/data/lldap_config.toml"]
<!-- gh-comment-id:1430318349 --> @nitnelave commented on GitHub (Feb 14, 2023): The CI docker image comes with a health check. Since there are several services to check, and the address depends on the config, it was simpler to implement in the app itself: ``` HEALTHCHECK CMD ["/app/lldap", "run", "--config-file", "/data/lldap_config.toml"] ```
Author
Owner

@JaneJeon commented on GitHub (Feb 14, 2023):

Ok, I'll just patiently wait for the next release :)

(I'll leave this open until an official release w/ the healthcheck is released)

<!-- gh-comment-id:1430321662 --> @JaneJeon commented on GitHub (Feb 14, 2023): Ok, I'll just patiently wait for the next release :) (I'll leave this open until an official release w/ the healthcheck is released)
Author
Owner

@JaneJeon commented on GitHub (Feb 14, 2023):

Wait a minute. Am I reading this correctly?

https://github.com/nitnelave/lldap/blob/main/Dockerfile#L95-L97

It seems to me that you are running the exact same /app/lldap as the entrypoint, with no difference in command (i.e. both are lldap run --config-file /data/lldap_config.toml).

So.. is the healthcheck literally just spinning up the app server? Does that not create countless instances of the same app server??

Just trying to understand what is going on here, because from a quick glance, it seems very wrong?

<!-- gh-comment-id:1430480346 --> @JaneJeon commented on GitHub (Feb 14, 2023): Wait a minute. Am I reading this correctly? https://github.com/nitnelave/lldap/blob/main/Dockerfile#L95-L97 It seems to me that you are running the exact same /app/lldap as the entrypoint, with no difference in command (i.e. both are `lldap run --config-file /data/lldap_config.toml`). So.. is the healthcheck literally just spinning up the app server? Does that not create countless instances of the same app server?? Just trying to understand what is going on here, because from a quick glance, it _seems_ very wrong?
Author
Owner

@JaneJeon commented on GitHub (Feb 14, 2023):

And given the existing health endpoint, it seems the correct health cmd should really be:

wget --no-verbose --tries=1 --spider http://localhost:17170/health || exit 1

I think?

<!-- gh-comment-id:1430484649 --> @JaneJeon commented on GitHub (Feb 14, 2023): And given the existing health endpoint, it seems the correct health cmd should _really_ be: ``` wget --no-verbose --tries=1 --spider http://localhost:17170/health || exit 1 ``` I think?
Author
Owner

@martadinata666 commented on GitHub (Feb 15, 2023):

the latest docker image had lldap healthcheck command and return code 200 on success. is it sufficient? or if it work as intended? 🤔
And taking on compose sample, override the healthcheck parameters.

version: "3"

volumes:
  lldap_data:
    driver: local

services:
  lldap:
    image: nitnelave/lldap:latest
    ports:
      # For LDAP
      - "3890:3890"
      # For the web front-end
      - "17170:17170"
    volumes:
      - "lldap_data:/data"
      # Alternatively, you can mount a local folder
      # - "./lldap_data:/data"
    environment:
      - UID=####
      - GID=####
      - TZ=####/####
      - LLDAP_JWT_SECRET=REPLACE_WITH_RANDOM
      - LLDAP_LDAP_USER_PASS=REPLACE_WITH_PASSWORD
      - LLDAP_LDAP_BASE_DN=dc=example,dc=com
    healthcheck:
      test: /app/lldap healthcheck || exit 1
      interval: 60s
      retries: 5
      start_period: 20s
      timeout: 10s
<!-- gh-comment-id:1430705142 --> @martadinata666 commented on GitHub (Feb 15, 2023): the latest docker image had `lldap healthcheck` command and return code 200 on success. is it sufficient? or if it work as intended? 🤔 And taking on compose sample, override the healthcheck parameters. ``` version: "3" volumes: lldap_data: driver: local services: lldap: image: nitnelave/lldap:latest ports: # For LDAP - "3890:3890" # For the web front-end - "17170:17170" volumes: - "lldap_data:/data" # Alternatively, you can mount a local folder # - "./lldap_data:/data" environment: - UID=#### - GID=#### - TZ=####/#### - LLDAP_JWT_SECRET=REPLACE_WITH_RANDOM - LLDAP_LDAP_USER_PASS=REPLACE_WITH_PASSWORD - LLDAP_LDAP_BASE_DN=dc=example,dc=com healthcheck: test: /app/lldap healthcheck || exit 1 interval: 60s retries: 5 start_period: 20s timeout: 10s ```
Author
Owner

@nitnelave commented on GitHub (Feb 15, 2023):

You're right, the healthcheck command should be lldap healthcheck :D I'll fix that right away.

<!-- gh-comment-id:1430999835 --> @nitnelave commented on GitHub (Feb 15, 2023): You're right, the healthcheck command should be `lldap healthcheck` :D I'll fix that right away.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/lldap-lldap#170
No description provided.