Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer "command" over dockerfileLines for one-click-app customizations #1202

Merged

Conversation

IamJeffG
Copy link
Contributor

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 a HEALTHCHECK 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:

image

Also the version of the currently deployed app can always be viewed in the CapRover UI, under Deployment > Version History:

Screenshot from 2025-02-25 10-13-30

By contrast, when the one-click app was used dockerfileLines to specify both the version and customizations,

  • the CapRover admin user cannot view the customizations anywhere after installation.
  • the CapRover admin user cannot view the current app version deployed.
  • the CapRover admin user cannot easily bump to a new app Docker version; he needs to re-create the entire custom dockerfileLines from scratch.

What I changed

  1. Switch redis one-click app to use docker-compose command: & image: instead of caproverExtra.dockerfileLines.

    • To verify this works, I installed the new one-click app and successfully connected to it from another container.
    • To verify the value-add of this PR, I successfully upgraded my installed redis app to a newer version of redis simply by using "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.
  2. Switch filebrowser one-click app to use docker-compose command: & image: to set the database and files root, instead of caproverExtra.dockerfileLines.

    • To verify this works, I installed the new one-click app, and viewed files on a Docker-managed volume and also on a localhost volume mount.

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

  • I have tested the template using the method described in README.md thoroughly
  • out of scope I have ensured that I put as much default values as possible (except passwords) to ensure minimum effort required for end users to get started.
  • I have ensured that I am not using the "latest" tag as this tag is dynamically changing and might break the one-click app. Use a fixed version.
  • out of scope I have made sure that instructions.start and instructions.end are clear and self-explanatory.
  • out of scope Icon is added as a png file to the logos directory.
  • I've executed the checks if necessary by running npm ci && npm run validate_apps && npm run formatter (If failling run the prettier: npm run formatter-write)
  • I will take responsibility addressing any issues that arises as a result of this PR (maintaining this app).

Unlike dockerfileLines, this
- preserves one-click-app customizations across deployments,
- improves transparency in CapRover UI,
- simplifies app version upgrades.
@IamJeffG IamJeffG force-pushed the command-instead-of-dockerfileLines branch from 01a4df7 to e8f0fda Compare February 25, 2025 16:24
@githubsaturn
Copy link
Collaborator

Thanks for the PR and thorough explanation!

@githubsaturn githubsaturn merged commit 15b0aa7 into caprover:master Feb 26, 2025
1 check passed
@IamJeffG
Copy link
Contributor Author

Thanks! As a power-user of CapRover I actually suggest you give some thought to recommending as a "Best Practice" using Service Update Overrides in favor of deploying from custom Dockerfile. That CapRover cannot recover the dockerfileLines if the image got deleted, or cannot support easy app upgrades when running a custom-built Dockerfile is a bit dangerous IMO.

@IamJeffG IamJeffG deleted the command-instead-of-dockerfileLines branch February 26, 2025 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants