[FIX] Tweaking Docker setup to enable running shell commands when deployed #101
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?
Fixes #100
The default Docker implementation for this template hardcodes the
rails server
startup within theentrypoint.sh
. This disables the ability to run other commands when the container is running. For example, when deployed to Heroku, you cannot open a shell to your container.WHAT is this pull request doing?
It moves the
rails server
startup command outside ofentrypoint.sh
and into theDockerfile
, supporting the existing behavior. However, it also allows you to override the CMD being run so you can execute shell commands as well.It also adds a sanity check before deleting the existing
server.pid
in case it doesn't actually exist.Checklist
Note: once this PR is merged, it becomes a new release for this template.
README.md
file and other related documentation, if applicable