diff --git a/compose.yml b/compose.yml index 00b2481..b81b8b7 100644 --- a/compose.yml +++ b/compose.yml @@ -1,23 +1,25 @@ --- -version: "3.7" +version: "3.8" services: app: - restart: unless-stopped image: listmonk/listmonk:latest networks: - internal - proxy environment: - TZ=Etc/UTC - - LISTMONK_DB_HOST=db + - LISTMONK_DB_HOST=${STACK_NAME}_db + secrets: + - db_password + - admin_password depends_on: - db configs: - source: config_toml target: /listmonk/config.toml - source: app_entrypoint - target: /docker_entrypoint.sh + target: /docker-entrypoint.sh mode: 0555 entrypoint: /docker-entrypoint.sh deploy: @@ -41,7 +43,6 @@ services: - POSTGRES_PASSWORD_FILE=/run/secrets/db_password - POSTGRES_USER=listmonk - POSTGRES_DB=listmonk - restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U listmonk"] interval: 10s @@ -62,11 +63,10 @@ configs: config_toml: name: ${STACK_NAME}_config_toml_${CONFIG_TOML_VERSION} file: config.toml.tmpl - # template_driver: golang + template_driver: golang app_entrypoint: name: ${STACK_NAME}_app_entrypoint_${APP_ENTRYPOINT_VERSION} file: docker-entrypoint.sh - # template_driver: golang networks: internal: diff --git a/config.toml.tmpl b/config.toml.tmpl index 2fb5a0b..e96c44d 100644 --- a/config.toml.tmpl +++ b/config.toml.tmpl @@ -5,7 +5,7 @@ admin_password = "{{ secret "admin_password" }}" # Database. [db] -host = "{{ env "LISTMONK_DB_HOST" }} " +host = "{{ env "LISTMONK_DB_HOST" }}" port = 5432 user = "listmonk" password = "{{ secret "db_password" }}" diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 3201f71..63a6274 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,4 +1,6 @@ #!/bin/sh +set -e cd /listmonk -./listmonk --install || ./listmonk --upgrade +./listmonk --install --yes --idempotent +./listmonk --upgrade --yes ./listmonk