diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 420a36c..f04017b 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,4 +1,17 @@ #!/usr/bin/env bash +# Load the .env file +if [ -f "${DOTENV_PATH:-/var/www/html/.env}" ]; then + # Export environment variables from the .env file + while IFS='=' read -r key value; do + # Skip comments and empty lines + if [[ ! "$key" =~ ^# && -n "$key" ]]; then + export "$key=$value" + fi + done < "${DOTENV_PATH:-/var/www/html/.env}" +else + echo ".env file not found" +fi + set -Eeuo pipefail sourceTarArgs=( @@ -103,4 +116,4 @@ fi exec "$@" ## echo "127.0.0.1 $(hostname) localhost localhost.localdomain" >> /etc/hosts; -## service sendmail restart \ No newline at end of file +## service sendmail restart