devilbox / docker-php-fpm

Devilbox's PHP-FPM Docker Images
http://devilbox.org
MIT License
351 stars 83 forks source link

Add project-specific startup script support (eg. for cron configuration) #263

Open martin-rueegg opened 1 year ago

martin-rueegg commented 1 year ago

Allow user to add .sh files to `$HOST_PATH_HTTPD_DATADIR//.devilbox/autostart` which will then be executed on startup of the php container.

martin-rueegg commented 1 year ago

As an alternative, which would make more sense and is more flexible, I would add this directly into the Devilbox as an example script. Similar to what has been done here in the autostart/ dir for blackfire and nodejs:

https://github.com/cytopia/devilbox/tree/master/autostart

The disadvantage of the global autostart directory is that it is not project-specific and hence not distributed with the project code (e.g. via version control). It requires every developer working on the project to run additional installation steps for the project.

cytopia commented 1 year ago

As an alternative, which would make more sense and is more flexible, I would add this directly into the Devilbox as an example script. Similar to what has been done here in the autostart/ dir for blackfire and nodejs: https://github.com/cytopia/devilbox/tree/master/autostart

The disadvantage of the global autostart directory is that it is not project-specific and hence not distributed with the project code (e.g. via version control). It requires every developer working on the project to run additional installation steps for the project.

The global autostart (all versions or per version) offers exactly this functionality. You can add any kind of shell script. It is just a generic way to start things up. What you do with it is totally up to the user.

What I can think of, is to add some generic template scripts *-example or add this to the documentation.

martin-rueegg commented 1 year ago

As an alternative, which would make more sense and is more flexible, I would add this directly into the Devilbox as an example script. Similar to what has been done here in the autostart/ dir for blackfire and nodejs: https://github.com/cytopia/devilbox/tree/master/autostart

The disadvantage of the global autostart directory is that it is not project-specific and hence not distributed with the project code (e.g. via version control). It requires every developer working on the project to run additional installation steps for the project.

The global autostart (all versions or per version) offers exactly this functionality. You can add any kind of shell script. It is just a generic way to start things up. What you do with it is totally up to the user.

What I can think of, is to add some generic template scripts *-example or add this to the documentation.

It would still require to deploy the autostart script.

With the updated version of the code, the vHost config dir MASS_VHOST_TEMPLATE_DIR/HTTPD_TEMPLATE_DIR is used.

Does that make it better suitable or are you against any built-in support for this (as opposed to the global autostart scripts?