1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-23 15:19:38 +02:00
Maybe/render.yaml
Zach Gollwitzer 5aca2ff9b6
Add zero-config self hosting on Render (#612)
* v1 of backend implementation for self hosting

* Add docs

* Add upgrades controller

* Add global helpers for self hosting mode

* Add self host settings controller

* Conditionally show self hosting settings

* Environment and config updates

* Complete upgrade prompting flow

* Update config for forked repo

* Move configuration of github provider within class

* Add upgrades cron

* Update deploy button

* Update guides

* Fix render deployer

* Typo

* Enable auto upgrades

* Fix cron

* Make upgrade modes more clear and consistent

* Trigger new available version

* Fix logic for displaying upgrade prompts

* Finish implementation

* Fix regression

* Trigger new version

* Add i18n translations

* trigger new version

* reduce caching time for testing

* Decrease cache for testing

* trigger upgrade

* trigger upgrade

* Only trigger deploy once

* trigger upgrade

* If target is commit, always upgrade if any upgrade is available

* trigger upgrade

* trigger upgrade

* Test release

* Change back to maybe repo for defaults

* Fix lint errors

* Clearer naming

* Fix relative link

* Add abs path

* Relative link

* Update docs
2024-04-13 09:28:45 -04:00

57 lines
1.8 KiB
YAML

databases:
- name: maybe
user: maybe
plan: free
services:
- type: web
plan: free
autoDeploy: false
runtime: ruby
name: maybe
repo: https://github.com/maybe-finance/maybe.git
branch: main
healthCheckPath: /up
buildCommand: "./bin/render-build.sh"
preDeployCommand: "bundle exec rails db:migrate"
startCommand: "bundle exec rails server"
envVars:
- key: DATABASE_URL
fromDatabase:
name: maybe
property: connectionString
- key: SELF_HOSTING_ENABLED
value: true
- key: HOSTING_PLATFORM
value: render
# Since the app is self-hosted, we cannot use master.key to encrypt credentials. App depends entirely on ENV variables
# https://api.rubyonrails.org/v7.1.3.2/classes/Rails/Application.html#method-i-secret_key_base
#
# To generate this, run: `openssl rand -hex 64` or `rails secret`
- key: SECRET_KEY_BASE
sync: false
- key: WEB_CONCURRENCY
value: 2
- key: GOOD_JOB_EXECUTION_MODE
value: async # Typically, `external` is used in prod, but this avoids another cron service and is generally fine for a self-hoster given low traffic
# The app uses this info to know which repo to fetch latest commit data from for upgrades
# This should MATCH the `repo` and `branch` keys in the config above ALWAYS
- key: GITHUB_REPO_OWNER
value: maybe-finance
- key: GITHUB_REPO_NAME
value: maybe
- key: GITHUB_REPO_BRANCH
value: main
# Required to allow your self-hosted instance to be able to upgrade itself
- key: UPGRADES_ENABLED
value: true
# If you upgrade your instance to a paid plan, you can set this to false (or remove it)
# See note in `render-build.sh` script.
- key: RUN_DB_MIGRATIONS_IN_BUILD_STEP
value: true