serversideup / docker-php

🐳 Production-ready Docker images for PHP. Optimized for Laravel, WordPress, and more!
https://serversideup.net/open-source/docker-php/
GNU General Public License v3.0
1.65k stars 108 forks source link

Improve Horizon Support #361

Open jaydrogers opened 3 months ago

jaydrogers commented 3 months ago

Background

I've been working with @nckrtl on optimizing Horizon support

Related Discord Discussion

https://discord.com/channels/910287105714954251/1235899514867683430

### Research Solution
- [x] Ensure Horizon fix is stable
- [x] Test entrypoint script
- [ ] Implement entrypoint script into serversideup/php
- [ ] Change order to be `start-first` for Swarm
### Documentation
- [ ] Show example of Laravel Horizon
- [ ] Show differences between Laravel Horizon and Laravel Queues ([example discussion](https://github.com/serversideup/docker-php/discussions/366#discussioncomment-9475434))
- [ ] Create video how Horizon works
- [ ] Post an update on https://github.com/laravel/horizon/issues/663
jaydrogers commented 3 months ago

@nckrtl: I just added some ToDos for myself above. Any other ideas that need to be added to this list, let me know.

Next week I will be partially out of the office, but I will start diving into this when I return the week after 👍

nckrtl commented 3 months ago

Looks complete to me. Still need to verify assumptions as discussed on Discord. Will give it this weekend a try.

nckrtl commented 3 months ago

Alright, I did a test and can confirm everything is working as expected with setting the horizon docker service order to start-first in docker-compose, but there are a few more requirements which need to be set properly in the Laravel project:

Because of the start-first a new container will start upon a new deployment while the old one will stay active and finish until horizon terminates gracefully. Made a video to demo it all. Might take a bit before the quality is bumped enough by YT for it to be watchable.

https://www.youtube.com/watch?v=NJ0Vj9nwgf4