diff --git a/compose.yml b/compose.yml index 429ff2a..b702af1 100644 --- a/compose.yml +++ b/compose.yml @@ -115,7 +115,8 @@ configs: template_driver: golang app_entrypoint: name: ${STACK_NAME}_app_entrypoint_${APP_ENTRYPOINT_VERSION} - file: entrypoint.sh + file: entrypoint.sh.tmpl + template_driver: golang secrets: db_password: diff --git a/entrypoint.sh b/entrypoint.sh.tmpl similarity index 67% rename from entrypoint.sh rename to entrypoint.sh.tmpl index 29cb63e..3f14afb 100644 --- a/entrypoint.sh +++ b/entrypoint.sh.tmpl @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh set -e @@ -25,9 +25,10 @@ file_env() { } file_env "PEERTUBE_DB_PASSWORD" +{{ if (env "PEERTUBE_SMTP_ENABLED") }} +file_env "PEERTUBE_SMTP_PASSWORD" +{{ end }} -if [ -z "$PEERTUBE_SMTP_PASSWORD_FILE" ]; then - file_env "PEERTUBE_SMTP_PASSWORD" -fi - +# upstream entrypoint +# https://github.com/Chocobozzz/PeerTube/blob/66f77f63437c6774acbd72584a9839a7636ea167/support/docker/production/entrypoint.sh /usr/local/bin/entrypoint.sh "$@"