shinsenter / php

📦 Simplified PHP Docker images for effortless customization and extension setup. Our Docker images cover PHP versions from 5.6 to 8.4, available in CLI, ZTS, FPM, FPM/Apache2, FPM/Nginx, RoadRunner, FrankenPHP, and Nginx Unit variants, for both Debian and Alpine versions. Updated everyday.
https://hub.docker.com/r/shinsenter/php
GNU General Public License v3.0
123 stars 27 forks source link

Missing laravel queues/s6 long-running process feature/documentation #100

Closed aclare92 closed 1 month ago

aclare92 commented 1 month ago

Hi, this is not exactly an issue but a query on how to use the containers.

Since 5.0 there are no longer any files for \etc\services.d\300-queue so one could presume you no longer support long-running processes in containers from 5.0. I don't see any documentation on this deprecation or if this is still a feature, how to implement this in the new containers. I use Laravel as the example here, where we can run database queues in the background, where CRON is reserved for the artisan schedule command.

Hoping you can help, otherwise, amazing work as always on these containers, I have followed you for a while and have also previously contributing to the project. I am happy to contribute again with some documentation once I confirm your position on supporting the above.

shinsenter commented 1 month ago

@aclare92

Thank you for reaching out and noticing this small change in our Docker containers. We made this adjustment because of the many requests for more flexibility in configuring queue processes. Since not every project needs to run both the queue and web in the same container, we felt it would be better to let users decide how they want to handle queues in their projects.

Starting with version 5.x, we've focused more on creating Docker containers that are broadly useful for PHP projects, rather than being tailored to a specific framework. Feedback like yours is invaluable in helping us refine features that are beneficial to most projects.

Regarding your issue, there are several ways to address it, all of which align with Docker's recommendation that each container should run a single application (see official Docker documentation).

Here are a few suggestions (and I can provide code examples if needed):

  1. Use one container for the web server and a separate container to run Laravel's artisan schedule.
  2. Enable crontab within the container and add a cron job for artisan schedule.

These approaches allow you to fine-tune the parameters and commands needed to operate queues effectively.

Additionally, if you prefer to retain the queue functionality found in Docker images prior to version 5.x, you can use the images tagged as "deprecated", though please note that they will no longer receive updates.

https://hub.docker.com/r/shinsenter/laravel/tags?name=deprecated

Best regards

shinsenter commented 1 month ago

P.s. If you have any idea to make the documentation better, I always welcome your pull requests. Since I’m not a native English speaker, my documentation is quite basic and not very detailed. I believe it would be much better with contributions from active users like you to improve it.