Remove custom entrypoint

Karrot can now read _FILE config values natively
This commit is contained in:
Nick Sellen 2024-01-26 00:26:14 +00:00
parent b6ddeb89b9
commit e9b65d460d
Signed by: nicksellen
GPG Key ID: 7C3A275C0DC2EFA1
3 changed files with 0 additions and 45 deletions

View File

@ -1,3 +1,2 @@
export NGINX_CONFIG_VERSION=v23
export GEOIP_CONFIG_VERSION=v1
export ENTRYPOINT_VERSION=v3

View File

@ -44,10 +44,6 @@ services:
- source: geoip_conf
target: /etc/GeoIP.conf
mode: 0555
- source: entrypoint
target: /custom-entrypoint.sh
mode: 0555
entrypoint: /custom-entrypoint.sh
secrets:
- db_password
- secret_key
@ -122,11 +118,6 @@ services:
volumes:
- "shiv_data:/root/.shiv"
- "geoip_data:/var/lib/GeoIP"
configs:
- source: entrypoint
target: /custom-entrypoint.sh
mode: 0555
entrypoint: /custom-entrypoint.sh
networks:
- internal
secrets:
@ -219,9 +210,6 @@ configs:
name: ${STACK_NAME}_geoip_conf_${GEOIP_CONFIG_VERSION}
file: geoip.conf.tmpl
template_driver: golang
entrypoint:
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
file: entrypoint.sh
secrets:
db_password:

View File

@ -1,32 +0,0 @@
#!/bin/bash
set -e
file_env() {
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"
}
file_env DATABASE_PASSWORD
file_env SECRET_KEY
file_env SMTP_PASSWORD
file_env VAPID_PRIVATE_KEY
/docker-entrypoint.sh