Bootstrap Cache is not shared between the containers #637
Replies: 2 comments 1 reply
-
|
By “sharing” the bootstrap cache, I meant mounting the same |
Beta Was this translation helpful? Give feedback.
-
|
Sorry for the delay on this. I was heads down getting Self-Host Pro out the door 🤪 I noticed @lukasleitsch had a mix of named volumes and bind mount volumes. Depending on your use case, you might want all or nothing with that (depending on the environment). I put together this blog post as a guide: https://serversideup.net/blog/docker-compose-bind-mounts-vs-named-volumes/ But sharing volumes across multiple containers for Laravel is a great idea. It's exactly what we do for Spin. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I ran a Laravel app with this Docker Compose file. One container (web) has the actual app with Autorun enabled. Autorun runs
artisan optimize. Only the web container benefits from the bootstrap cache in/var/www/html/bootstrap/cache. Thetaskandhorizoncontainers do not have this cache.The Health-Checks Package from Spatie runs checks via the scheduler, which runs in the task container. The check fails because that container has no bootstrap cache.
How do you solve this issue? My solution was to add a shared volume for the bootstrap cache folder. (See below)
With Bootstrap cache volume:
Beta Was this translation helpful? Give feedback.
All reactions