listmonk icon indicating copy to clipboard operation
listmonk copied to clipboard

Docker Compose file does not use the declared environment variable for Postgres healthcheck

Open Mawiguk0 opened this issue 9 months ago • 1 comments

Version:

  • listmonk: 4.1.0
  • OS: Ubuntu 24.04.5 LTS (Docker Compose)

Description:

The current docker-compose.yml defines the Postgres healthcheck with a hardcoded username (listmonk) instead of referencing the declared $POSTGRES_USER environment variable. This breaks consistency and can lead to subtle bugs if the username is changed in the environment section but not updated in the healthcheck.

Current (relevant snippet):

healthcheck:
  test: ["CMD-SHELL", "pg_isready -U listmonk"]
  interval: 10s
  timeout: 5s
  retries: 6

Suggested improvement:

healthcheck:
  test: ["CMD-SHELL", "pg_isready -U $POSTGRES_USER"]
  interval: 10s
  timeout: 5s
  retries: 6

This uses the existing POSTGRES_USER variable already declared via the *db-credentials anchor in the environment section.

Reference:
See [docker-compose.yml#L54](https://github.com/knadh/listmonk/blob/4d8c8cdedd91fb08ca88b790733446e34c94e495/docker-compose.yml#L54)


Would be great to hear if others agree this would be a safer and cleaner approach. I plan to open a PR to fix this once confirmed.

Mawiguk0 avatar Apr 16 '25 08:04 Mawiguk0

Please do send a PR.

knadh avatar Apr 16 '25 11:04 knadh

This issue has been marked 'stale' after 90 days of inactivity. If there is no further activity, it will be closed in 7 days.

github-actions[bot] avatar Jul 16 '25 02:07 github-actions[bot]