Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added database migrate and keygeneration as startup action #39

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,22 @@ sed 's,{{REDIS_PORT}},'"${REDIS_PORT}"',g' -i /var/www/html/.env

php composer.phar install --no-dev -o

# We have to be careful with automated database migrations
# (especially in cases of version upgrades).
# So the user can control the migrate command by an env var.
# If this will be filled with "YES", it will be migrated :)
if [ "${DB_MIGRATION}" == "YES" ]; then
php artisan migrate --force
fi

# Generate a new APP_KEY for Laravels sensitive information.
# Only if no APP_KEY env var is set or the default value ("SECRET") is assigned
if [ "${APP_KEY:-SECRET}" == "SECRET" ]; then
php artisan key:generate
# Generate Laravels configuration cache after the key generation again
php artisan config:cache
fi

echo "Starting supervisord..."
exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf

Expand Down