Skip to content

Commit

Permalink
Make sure .env file is created or exists
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k3lm committed Sep 11, 2024
1 parent 113c0dc commit 666405e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ services:
- "mariadb_data:/bitnami/mariadb"
ports:
- "${MAGENTO_MYSQL_PORT}:3306"
env_file:
- path: ./.env.sample
required: true
- path: ./.env
required: false
magento:
image: docker.io/bitnami/magento:${MAGENTO_VERSION:-latest}
ports:
Expand Down
3 changes: 3 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ set -o allexport
source .env.sample
if [ -f .env ]; then
source .env
else
echo "⚠️ No .env file found, coping from .env.sample"
cp .env.sample .env
fi
set +o allexport

Expand Down

0 comments on commit 666405e

Please sign in to comment.