Improving entrypoint.sh to run services in foreground #455
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
Running Docker on Heroku or locally with the previous entrypoint.sh we cannot access the container's terminal since it's not running the services in the foreground.
WHAT is this pull request doing?
I'm running php-fpm and nginx in the background, allowing easy access to the container's terminal when using Heroku or the local environment.
In a Docker environment, it's better to avoid using init systems like OpenRC and instead to start the main process of the container (in this case, nginx or php-fpm) directly in the foreground. That's why it's more common to see nginx -g 'daemon off;' or php-fpm as the command to start the container. This is because Docker itself takes over many of the roles of an init system.
Checklist
Note: once this PR is merged, it becomes a new release for this template.
README.md
file and other related documentation, if applicable