generated from coop-cloud/example
Tidy up
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
bcc890338b
commit
beb4e023a1
11
compose.yml
11
compose.yml
|
@ -45,8 +45,9 @@ networks:
|
||||||
volumes:
|
volumes:
|
||||||
filestash_state:
|
filestash_state:
|
||||||
|
|
||||||
configs:
|
# NOTE(3wc): See above note
|
||||||
entrypoint_conf:
|
# configs:
|
||||||
name: ${STACK_NAME}_entrypoint_conf_${ENTRYPOINT_CONF_VERSION}
|
# entrypoint_conf:
|
||||||
file: entrypoint.sh.tmpl
|
# name: ${STACK_NAME}_entrypoint_conf_${ENTRYPOINT_CONF_VERSION}
|
||||||
template_driver: golang
|
# file: entrypoint.sh.tmpl
|
||||||
|
# template_driver: golang
|
||||||
|
|
|
@ -1,43 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
file_env() {
|
|
||||||
# 3wc: Load $VAR_FILE into $VAR - useful for secrets. See
|
|
||||||
# https://medium.com/@adrian.gheorghe.dev/using-docker-secrets-in-your-environment-variables-7a0609659aab
|
|
||||||
local var="$1"
|
|
||||||
local fileVar="${var}_FILE"
|
|
||||||
local def="${2:-}"
|
|
||||||
|
|
||||||
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
|
|
||||||
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
local val="$def"
|
|
||||||
if [ "${!var:-}" ]; then
|
|
||||||
val="${!var}"
|
|
||||||
elif [ "${!fileVar:-}" ]; then
|
|
||||||
val="$(< "${!fileVar}")"
|
|
||||||
fi
|
|
||||||
export "$var"="$val"
|
|
||||||
unset "$fileVar"
|
|
||||||
}
|
|
||||||
|
|
||||||
load_vars() {
|
|
||||||
file_env "ADMIN_PASSWORD"
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
load_vars
|
|
||||||
}
|
|
||||||
|
|
||||||
main
|
|
||||||
|
|
||||||
# 3wc: `source /docker-entrypoint2.sh -e` to load ADMIN_PASSWORD for CLI scripts
|
|
||||||
if [ ! "${1-}" == "-e" ]; then
|
|
||||||
# 3wc: upstream ENTRYPOINT
|
|
||||||
# https://github.com/hedgedoc/container/blob/master/alpine/Dockerfile
|
|
||||||
/app/filestash
|
|
||||||
fi
|
|
||||||
|
|
||||||
set +eu
|
|
Loading…
Reference in New Issue