From 761320788bb7d90ca26de2b28fae4c713f1da895 Mon Sep 17 00:00:00 2001 From: notplants Date: Tue, 4 Nov 2025 14:20:01 -0500 Subject: [PATCH] working with secrets --- abra-entrypoint.sh | 7 ------- abra.sh | 1 + compose.yml | 12 ++++++------ 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/abra-entrypoint.sh b/abra-entrypoint.sh index 9cb0bf4..552b18b 100644 --- a/abra-entrypoint.sh +++ b/abra-entrypoint.sh @@ -1,12 +1,9 @@ #!/bin/sh set -e -echo "++ running new entrypoint" ORIGINAL_ENTRYPOINT="$1" shift -echo "++ original entrypoint: ${ORIGINAL_ENTRYPOINT}" - [ -f /run/secrets/postgres_password ] && export DB_PASSWORD="$(cat /run/secrets/postgres_password)" [ -f /run/secrets/postgres_password ] && export POSTGRES_PASSWORD="$(cat /run/secrets/postgres_password)" [ -f /run/secrets/django_secret_key ] && export DJANGO_SECRET_KEY="$(cat /run/secrets/django_secret_key)" @@ -16,10 +13,6 @@ echo "++ original entrypoint: ${ORIGINAL_ENTRYPOINT}" [ -f /run/secrets/oidc_rp_client_secret ] && export OIDC_RP_CLIENT_SECRET="$(cat /run/secrets/oidc_rp_client_secret)" [ -f /run/secrets/collaboration_server_secret ] && export COLLABORATION_SERVER_SECRET="$(cat /run/secrets/collaboration_server_secret)" -echo "++ command: ${@}" -echo "++ env: " -printenv - # --- Execute the original entrypoint and command --- if [ -n "$ORIGINAL_ENTRYPOINT" ] && [ "$ORIGINAL_ENTRYPOINT" != "null" ]; then exec "$ORIGINAL_ENTRYPOINT" "$@" diff --git a/abra.sh b/abra.sh index 0c22e4b..08f3f3c 100755 --- a/abra.sh +++ b/abra.sh @@ -9,6 +9,7 @@ environment() { [ -f /run/secrets/postgres_password ] && export POSTGRES_PASSWORD="$(cat /run/secrets/postgres_password)" [ -f /run/secrets/django_secret_key ] && export DJANGO_SECRET_KEY="$(cat /run/secrets/django_secret_key)" [ -f /run/secrets/minio_root_password ] && export MINIO_ROOT_PASSWORD="$(cat /run/secrets/minio_root_password)" + [ -f /run/secrets/minio_root_password ] && export AWS_S3_SECRET_ACCESS_KEY="$(cat /run/secrets/minio_root_password)" [ -f /run/secrets/django_superuser_password ] && export DJANGO_SUPERUSER_PASSWORD="$(cat /run/secrets/django_superuser_password)" [ -f /run/secrets/oidc_rp_client_secret ] && export OIDC_RP_CLIENT_SECRET="$(cat /run/secrets/oidc_rp_client_secret)" [ -f /run/secrets/collaboration_server_secret ] && export COLLABORATION_SERVER_SECRET="$(cat /run/secrets/collaboration_server_secret)" diff --git a/compose.yml b/compose.yml index a94c968..6497189 100644 --- a/compose.yml +++ b/compose.yml @@ -103,12 +103,12 @@ services: - backend environment: <<: [*common-env, *postgres-env, *yprovider-env] -# healthcheck: -# test: ["CMD", "python", "manage.py", "check"] -# interval: 15s -# timeout: 30s -# retries: 20 -# start_period: 10s + healthcheck: + test: ["CMD", "/abra-entrypoint.sh", "python", "manage.py", "check"] + interval: 15s + timeout: 30s + retries: 20 + start_period: 10s command: ["gunicorn", "-c", "/usr/local/etc/gunicorn/impress.py", "impress.wsgi:application"] entrypoint: ["/abra-entrypoint.sh", "/usr/local/bin/entrypoint"] configs: