-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Consider running migrations automatically at startup in Docker image #8953
Comments
Well it looks like this was already addressed in #6680. However, the Docker startup script (for v5.0.11 at least) is severely broken: ...
exec supervisord -c /supervisord.conf
php artisan migrate --force
php artisan config:clear
php artisan config:cache
. /etc/apache2/envvars
exec apache2 -DNO_DETACH < /dev/null Note that nothing after the first
I fixed up this in #6606, but somewhere along the way it was broken. I suspect that there was a bad merge that went undetected. I think the right fix is simply this: ...
php artisan migrate --force
php artisan config:clear
php artisan config:cache
exec supervisord -c /supervisord.conf |
Actually, it looks like the first
|
This seems pretty reasonable on the face of it. I’m a little worried about what might happen if you “test out” a new image and then go back to your old one, but generally, we try to make our db changes pretty cautiously and backwards-compatibly. I’ll keep thinking about it, but initially, I like it. |
A typical behavior of dockerized web applications is to always run any database migrations at container startup (e.g. in an entrypoint script). This way, an upgrade consists of nothing more than changing the image name and recreating the container.
Examples:
This would solve problems encountered by users like #8813 (comment)
The text was updated successfully, but these errors were encountered: