Prefer "command" over dockerfileLines for one-click-app customizations #1202
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.
Maintain one-click-app customizations across subsequent deployments.
Motivation
There are times you need to change some of the configuration inside the upstream Docker image. We have found that it's best practice to use Service Update Override (instead of alternatives like using
dockerfileLines
to build a derivative image with overridden configuration).I acknowledge that there are types of customization when
dockerfileLines
is needed (such as to disable aHEALTHCHECK
defined in the Dockerfile on a worker service), but these end up being extremely rare.Persistence of config
Service Update Override persists when a new image is deployed (for example, you want to bump the app software version through "Deploy via ImageName").
Better Transparency
The modifications to app config can always be viewed in the CapRover UI, under
App Configs > Service Update Override
:Also the version of the currently deployed app can always be viewed in the CapRover UI, under
Deployment > Version History
:By contrast, when the one-click app was used
dockerfileLines
to specify both the version and customizations,dockerfileLines
from scratch.What I changed
Switch redis one-click app to use docker-compose
command:
&image:
instead ofcaproverExtra.dockerfileLines
."Deploy via ImageName": redis:7.4.2
; the configuration (password and data volume) are maintained across this upgrade without me needing to know about them.Switch filebrowser one-click app to use docker-compose
command:
&image:
to set the database and files root, instead ofcaproverExtra.dockerfileLines
.Another unexpected upshot of these changes is also that the one-click app YAML is also now more straightforward: closer to a traditional docker-compose.yml.
☑️ Self Check before Merge
npm ci && npm run validate_apps && npm run formatter
(If failling run the prettier:npm run formatter-write
)