Improve docker support

- Add docker-compose file
- Add environment variable to initialize the database
- Add custom entrypoint that generates the .env file based on the environment variables
- Update Dockerfile (gettext-base package)
This commit is contained in:
Christian Musa
2017-02-11 00:33:20 -03:00
parent 3914796e4e
commit 0cbed2d5d2
4 changed files with 107 additions and 0 deletions

16
docker/entrypoint.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
cat .env.docker | envsubst > .env
if [ "${INIT_DATABASE:="no"}" = "yes" ]; then
echo "Init database detected, checking mysql status"
# depends on your machine, but it may take a file to boot mysql container the first time
until php artisan firefly:verify &>/dev/null
do
echo "waiting mysql"
sleep 10
done
php artisan migrate:refresh --seed
fi
exec apache2-foreground