diff --git a/blueprints/listmonk/docker-compose.yml b/blueprints/listmonk/docker-compose.yml index d9da8b5..a77ebeb 100644 --- a/blueprints/listmonk/docker-compose.yml +++ b/blueprints/listmonk/docker-compose.yml @@ -3,42 +3,40 @@ services: image: postgres:17-alpine ports: - 5432 - environment: - - POSTGRES_PASSWORD=listmonk - POSTGRES_USER=listmonk + - POSTGRES_PASSWORD=listmonk - POSTGRES_DB=listmonk restart: unless-stopped healthcheck: - test: ["CMD-SHELL", "pg_isready -U listmonk"] + test: [ "CMD-SHELL", "pg_isready -U listmonk" ] interval: 10s timeout: 5s retries: 6 volumes: - listmonk-data:/var/lib/postgresql/data - setup: - image: listmonk/listmonk:v4.1.0 - - volumes: - - ../files/config.toml:/listmonk/config.toml - depends_on: - - db - command: - [ - sh, - -c, - "sleep 3 && ./listmonk --install --idempotent --yes --config config.toml", - ] - app: restart: unless-stopped - image: listmonk/listmonk:v4.1.0 + image: listmonk/listmonk:v5.0.0 environment: + - LISTMONK_app__address=0.0.0.0:9000 + - LISTMONK_db__user=listmonk + - LISTMONK_db__password=listmonk + - LISTMONK_db__database=listmonk + - LISTMONK_db__host=db + - LISTMONK_db__port=5432 + - LISTMONK_db__ssl_mode=disable + - LISTMONK_db__max_open=25 + - LISTMONK_db__max_idle=25 + - LISTMONK_db__max_lifetime=300s - TZ=Etc/UTC depends_on: - db - - setup + command: [ sh, -c, "./listmonk --install --idempotent --yes --config '' && ./listmonk --upgrade --yes --config '' && ./listmonk --config ''" ] + # --config (file) param is set to empty so that listmonk only uses the env vars (below) for config. + # --install --idempotent ensures that DB installation happens only once on an empty DB, on the first ever start. + # --upgrade automatically runs any DB migrations when a new image is pulled. volumes: - ../files/config.toml:/listmonk/config.toml - listmonk-uploads:/listmonk/uploads diff --git a/blueprints/listmonk/template.toml b/blueprints/listmonk/template.toml index 633341b..9cf8069 100644 --- a/blueprints/listmonk/template.toml +++ b/blueprints/listmonk/template.toml @@ -25,5 +25,5 @@ max_open = 25 max_idle = 25 max_lifetime = "300s" -params = "" +params = "" """