db password stops working with secret
This commit is contained in:
@ -7,16 +7,15 @@ shift
|
|||||||
|
|
||||||
echo "++ original entrypoint: ${ORIGINAL_ENTRYPOINT}"
|
echo "++ original entrypoint: ${ORIGINAL_ENTRYPOINT}"
|
||||||
|
|
||||||
# --- Load secrets into environment variables ---
|
[ -f /run/secrets/postgres_password ] && export DB_PASSWORD="$(cat /run/secrets/postgres_password)"
|
||||||
if [ -d /run/secrets ]; then
|
[ -f /run/secrets/django_secret_key ] && export DJANGO_SECRET_KEY="$(cat /run/secrets/django_secret_key)"
|
||||||
for secret_file in /run/secrets/*; do
|
[ -f /run/secrets/django_superuser_password ] && export DJANGO_SUPERUSER_PASSWORD="$(cat /run/secrets/django_superuser_password)"
|
||||||
echo "++ loading secret: ${secret_file}"
|
[ -f /run/secrets/oidc_rp_client_secret ] && export OIDC_RP_CLIENT_SECRET="$(cat /run/secrets/oidc_rp_client_secret)"
|
||||||
var_name=$(basename "$secret_file" | tr '[:lower:]' '[:upper:]')
|
[ -f /run/secrets/collaboration_server_secret ] && export COLLABORATION_SERVER_SECRET="$(cat /run/secrets/collaboration_server_secret)"
|
||||||
export "$var_name"="$(cat "$secret_file")"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "++ command: ${@}"
|
echo "++ command: ${@}"
|
||||||
|
echo "++ env: "
|
||||||
|
printenv
|
||||||
|
|
||||||
# --- Execute the original entrypoint and command ---
|
# --- Execute the original entrypoint and command ---
|
||||||
if [ -n "$ORIGINAL_ENTRYPOINT" ] && [ "$ORIGINAL_ENTRYPOINT" != "null" ]; then
|
if [ -n "$ORIGINAL_ENTRYPOINT" ] && [ "$ORIGINAL_ENTRYPOINT" != "null" ]; then
|
||||||
|
|||||||
12
compose.yml
12
compose.yml
@ -59,13 +59,14 @@ x-postgres-env: &postgres-env
|
|||||||
POSTGRES_DB: docs
|
POSTGRES_DB: docs
|
||||||
POSTGRES_USER: docs
|
POSTGRES_USER: docs
|
||||||
# FIXME: Move to docker secret
|
# FIXME: Move to docker secret
|
||||||
POSTGRES_PASSWORD: password
|
XX_POSTGRES_PASSWORD: password
|
||||||
|
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||||
# App database configuration
|
# App database configuration
|
||||||
DB_HOST: db
|
DB_HOST: db
|
||||||
DB_NAME: docs
|
DB_NAME: docs
|
||||||
DB_USER: docs
|
DB_USER: docs
|
||||||
# FIXME: Move to docker secret
|
# FIXME: Move to docker secret
|
||||||
DB_PASSWORD: password
|
XX_DB_PASSWORD: password
|
||||||
DB_PORT: 5432
|
DB_PORT: 5432
|
||||||
|
|
||||||
x-yprovider-env: &yprovider-env
|
x-yprovider-env: &yprovider-env
|
||||||
@ -201,6 +202,13 @@ services:
|
|||||||
- source: abra_entrypoint
|
- source: abra_entrypoint
|
||||||
target: /abra-entrypoint.sh
|
target: /abra-entrypoint.sh
|
||||||
mode: 0555
|
mode: 0555
|
||||||
|
secrets:
|
||||||
|
- django_secret_key
|
||||||
|
- oidc_rp_client_secret
|
||||||
|
- django_superuser_password
|
||||||
|
- collaboration_server_secret
|
||||||
|
- minio_root_password
|
||||||
|
- postgres_password
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:8
|
image: redis:8
|
||||||
|
|||||||
Reference in New Issue
Block a user