Files
sendico/ci/dev/scripts/mongo-entrypoint.sh
2026-01-30 16:58:02 +01:00

14 lines
523 B
Bash

#!/usr/bin/env bash
# MongoDB entrypoint wrapper for dev environment
# Reads credentials from Vault secrets and initializes MongoDB
set -euo pipefail
# Read credentials from Vault Agent-rendered files
if [ -s /vault/secrets/MONGO_ROOT_USER ] && [ -s /vault/secrets/MONGO_ROOT_PASSWORD ]; then
export MONGO_INITDB_ROOT_USERNAME="$(cat /vault/secrets/MONGO_ROOT_USER)"
export MONGO_INITDB_ROOT_PASSWORD="$(cat /vault/secrets/MONGO_ROOT_PASSWORD)"
fi
# Execute original MongoDB entrypoint
exec docker-entrypoint.sh "$@"