From 9183de578d245264946703bcd1e599e8c210c3a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=BDubom=C3=ADr=20Ku=C4=8Dera?= Date: Thu, 14 Feb 2019 05:49:36 +0100 Subject: [PATCH] docker: Fix upgrades (#6680) Until now, the Docker image was not performing actions that are necessary for an upgrade completion. That is considered an anti-pattern. See https://snipe-it.readme.io/docs/upgrading for more information. --- docker/entrypoint.sh | 4 ++++ docker/entrypoint_alpine.sh | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 2a1e489400..9459701efa 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -47,5 +47,9 @@ then cp -ax /var/www/html/vendor/laravel/passport/database/migrations/* /var/www/html/database/migrations/ fi +php artisan migrate --force +php artisan config:clear +php artisan config:cache + . /etc/apache2/envvars exec apache2 -DNO_DETACH < /dev/null diff --git a/docker/entrypoint_alpine.sh b/docker/entrypoint_alpine.sh index 145ee44157..6ea96189d4 100644 --- a/docker/entrypoint_alpine.sh +++ b/docker/entrypoint_alpine.sh @@ -44,5 +44,10 @@ if [ ! -f "/var/www/html/database/migrations/*create_oauth*" ] then cp -a /var/www/html/vendor/laravel/passport/database/migrations/* /var/www/html/database/migrations/ fi + +php artisan migrate --force +php artisan config:clear +php artisan config:cache + export APACHE_LOG_DIR=/var/log/apache2 exec httpd -DNO_DETACH < /dev/null