Skip to content

Commit

Permalink
add migrations to docker startup
Browse files Browse the repository at this point in the history
  • Loading branch information
antedebaas committed Sep 28, 2023
1 parent 18e37e3 commit 01684a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh

echo "Generate .env.local file"
if [ ! -f "/var/www/html/.env.local" ]; then
APP_SECRET=$(echo "$RANDOM" | md5sum | head -c 32)
echo "APP_ENV=prod" >> /var/www/html/.env.local
Expand All @@ -8,4 +10,7 @@ if [ ! -f "/var/www/html/.env.local" ]; then
echo "MAILBOX_CONNECTION=\"$MAILER_HOST:$MAILER_IMAPPORT/imap/ssl\"" >> /var/www/html/.env.local
echo "MAILBOX_USERNAME=\"$MAILER_USER\"" >> /var/www/html/.env.local
echo "MAILBOX_PASSWORD=\"$MAILER_PASSWORD\"" >> /var/www/html/.env.local
fi
fi

echo "Run migrations"
php /var/www/html/bin/console doctrine:migrations:migrate --no-interaction
2 changes: 1 addition & 1 deletion dockerfiles/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pidfile=/run/supervisord.pid
user=root

[program:genconfig]
command=/usr/local/bin/genenvlocal.sh
command=/usr/local/bin/containerstartup.sh
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
Expand Down

0 comments on commit 01684a4

Please sign in to comment.