-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add zero-config self hosting on Render #612
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR introduces a system to allow for "zero config" / "one-click" self hosting deploys.
Overview
Below are some highlights of what this solution aims to accomplish:
disabled
- this turns off auto-updates. The user will be prompted in the UI for each new release and can manually upgrade if they wishrelease
- this automatically upgrades the self-hosted app each time a new release becomes available. This is the "stable" optioncommit
- this automatically upgrades the self-hosted app to the latest commit and mirrors Render's "auto deploy" functionalityTechnical Features
The main goal with this system design is to enable a self-hoster to get their app running without touching any code and enable incremental configuration via the UI.
Upgrader
class/namespace has been designed to be agnostic of the hosting platform. To support a new platform (such as Docker, Heroku, etc.), all that needs to be added is some configuration and aUpgrader::Deployer::<Platform>
class that knows how to auto-deploy the self hosted appUpgrader
is provided with git repository data using the pattern introduced in Implement swappable provider infrastructure #561 to keep track of new commits and releases that are available for upgradeconfig/initializers/version.rb
stores a hardcoded version number which will be updated manually each new release. This is required so the app knows which commits and releases are available for upgrade.rails-settings-cached
gem is used for global settings and can be 100% configured via environment variables and later changed in the UI by the self-hosting user.Upgrades
As described above—all users (whether self-hosted or paying users) will see notifications of new releases with changelogs. Self-hosted users will see special "prompts" to upgrade and can trigger new deploys within their app.
CleanShot.2024-04-11.at.17.05.14.mp4
Docker
This solution provides an extension point for setting up a Docker compose self-hosting configuration. In the future, a self-hosting user should be able to deploy to any Linux-enabled VPS with a single command (not supported yet):