Skip to content

Commit

Permalink
Merge pull request #30 from flikites/dev
Browse files Browse the repository at this point in the history
Update docker-entrypoint.sh - Load ENVs from file - dev branch
  • Loading branch information
alihm authored Nov 22, 2024
2 parents 07e6707 + cd1fae8 commit b97be21
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ RUN set -x \
&& mkdir /docker-entrypoint.d



# Set the working directory to /var/www/html
WORKDIR /var/www/

Expand Down
15 changes: 14 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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=(
Expand Down Expand Up @@ -103,4 +116,4 @@ fi
exec "$@"

## echo "127.0.0.1 $(hostname) localhost localhost.localdomain" >> /etc/hosts;
## service sendmail restart
## service sendmail restart

0 comments on commit b97be21

Please sign in to comment.