How to better custom our own image? #181
-
I want to make the deployment process easier, so I plan to build everything in a single image and run the queue and schedule from it. To achieve this, I have customized my own image with additional code on s6, as shown in the screenshots below. For the queue, I have included a script that checks if an Artisan file exists and assumes that Laravel is configured if it does. If AUTORUN_ENABLED is set to 'true' and AUTORUN_LARAVEL_QUEUE is set to 'true', the script runs the Laravel queue with specific parameters. If Laravel is not detected or is disabled, the script skips running the queue. I am unsure if this is the correct approach for customization, so please let me know if there are any recommendations for improvement. for qaueue
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Great stuff! Few quick comments: Reduce the copy command![]() Minimize your layers as much as possible. Rather than copying each file, you can copy the entire directory (and its sub directories & files) all at once. That's what I do here: Line 44 in 69641f3 Running a queue & schedulerI see you're injecting these scripts to run the services. Although that may work, you lose the supervision of the process. Instead, consider separating out your processes into multiple containers -- so you would have:
See these examples: Hope this helps! |
Beta Was this translation helpful? Give feedback.
Great stuff!
Few quick comments:
Reduce the copy command
Minimize your layers as much as possible. Rather than copying each file, you can copy the entire directory (and its sub directories & files) all at once. That's what I do here:
docker-php/src/fpm/Dockerfile
Line 44 in 69641f3
Running a queue & scheduler
I see you're injecting these scripts to run the services. Although that may work, you lose the supervision of the process.
Instead, consider separating out your processes into multiple containers -- so you would have:
See these examples:
https://serversideup.net/open-source/docker-php/docs/lara…