1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 15:49:39 +02:00

Improve self hosting docs (#732)

This commit is contained in:
Zach Gollwitzer 2024-05-10 06:10:23 -04:00 committed by GitHub
parent fac995b87e
commit 2aee8e3027
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 203 additions and 158 deletions

104
docs/hosting/docker.md Normal file
View file

@ -0,0 +1,104 @@
# Self Hosting Maybe with Docker
## Quick Start
_The below quickstart assumes you're running on Mac or Linux. Windows will
be different._
Make sure [Docker is installed](https://docs.docker.com/engine/install/) and
setup your local environment:
```bash
# Create a directory on your computer for Docker files
mkdir -p ~/docker-apps/maybe
cd ~/docker-apps/maybe
# Download the sample docker-compose.yml file from the Maybe Github repository
curl -o docker-compose.yml https://raw.githubusercontent.com/maybe-finance/maybe/main/docker-compose.example.yml
# Create an .env file (make sure to fill in empty variables manually)
cat << EOF > .env
# Use "openssl rand -hex 64" to generate this
SECRET_KEY_BASE=
# Can be any value, set to what you'd like
POSTGRES_PASSWORD=
EOF
```
Make sure to generate your `SECRET_KEY_BASE` value and save the `.env` file.
Then you're ready to run the app, which will be available at
`http://localhost:3000` in your browser:
```bash
docker-compose up -d
```
Lastly, go to `http://localhost:3000` in your browser, **create a new
account**, and you're ready to start tracking your finances!
## Detailed Setup Guide
### Prerequisites
- Install Docker Engine by
following [the official guide](https://docs.docker.com/engine/install/)
- Start the Docker service on your machine
### App Setup
1. Create a new directory on your machine (we suggest something like
`$HOME/docker-apps/maybe`)
2. Create a `docker-compose.yml` file (we suggest
using [our example](/docker-compose.example.yml)
if
you're new to self-hosting and Docker)
3. Create a `.env` file and add the required variables. Currently,
`SECRET_KEY_BASE` is the only required variable, but you can take a look
at our [.env.example](/.env.example) file to see all available options.
### Run app with Docker Compose
1. Run `docker-compose up -d` to start the maybe app in detached mode.
2. Access the Maybe app by navigating to http://localhost:3000 in your web
browser.
### Updating the App
The mechanism that updates your self-hosted Maybe app is the GHCR (Github
Container Registry) Docker image that you see in the `docker-compose.yml` file:
```yml
image: ghcr.io/maybe-finance/maybe:latest
```
We recommend using one of the following images, but you can pin your app to
whatever version you'd like (
see [packages](https://github.com/maybe-finance/maybe/pkgs/container/maybe)):
- `ghcr.io/maybe-finance/maybe:latest` (latest commit)
- `ghcr.io/maybe-finance/maybe:stable` (latest release)
By default, your app _will NOT_ automatically update. To update your
self-hosted app, you must run the following commands:
```bash
docker-compose pull # This pulls the "latest" published image from GHCR
docker-compose up -d # Restarts the app
```
#### Changing the image
If you'd like to pin the app to a specific version or tag, all you need to do is
edit the `docker-compose.yml` file:
```yml
image: ghcr.io/maybe-finance/maybe:stable
```
## Troubleshooting
This section will provide troubleshooting tips and solutions for common issues
encountered during deployment. Check back later for updates!

View file

@ -0,0 +1,91 @@
# Deploy Maybe in One Click
Below are our "one-click deploy" options for running Maybe in the cloud:
## Render
Welcome to the one-click deploy guide for Maybe on [Render](https://render.
com/)!
Render is a hosting platform with a generous free tier and makes it easy to get
started with Maybe:
- Getting started is FREE
- Up and running in <5 minutes
- Your Maybe app is automatically deployed to a live URL
### Estimated Costs
- FREE to _get up and running_
- $7 per month for a basic app (Render requires you to upgrade your database to
keep using it)
- $14+ per month for optimal performance
_**IMPORTANT:** if you plan to host Maybe on Render long-term, you MUST upgrade
your database to a paid Render service._
### Instructions
#### Step 1: Create Render Blueprint
<a href="https://render.com/deploy?repo=https://github.com/maybe-finance/maybe">
<img src="https://render.com/images/deploy-to-render-button.svg" alt="Deploy to Render" />
</a>
1. Click the button above.
2. Sign in or create your account with Render (FREE)
3. Give your blueprint a name (we suggest `Maybe`)
4. Select the `main` branch
5. You should see a section at the bottom with a "Key:Value" field
for `SECRET_KEY_BASE`. Do NOT click "generate".
6. On your computer, open a terminal and make sure you have
the [openssl](https://github.com/openssl/openssl) utility installed on your
computer. You can run `openssl --version` to verify it is installed.
7. Generate your `SECRET_KEY_BASE` by running the following command in your
terminal: `openssl rand -hex 64` ([docs](https://www.openssl.org/docs/man1.1.1/man1/rand.html)).
8. Do NOT share this value with anyone.
9. Go back to your browser and paste this value in the "Value" field
for `SECRET_KEY_BASE`
10. Click "Apply". This will take a few minutes.
11. Once complete, click on the `maybe` "Web Service". You should see a custom
URL in the format `https://maybe-abcd.onrender.com`. Click on it, and you'll
see your running Maybe app!
#### Step 2: Add your deploy hook for auto-updates
To get new releases, you will need to add your deploy hook to the app.
1. Click on the `maybe` "Web Service"
2. Click "Settings"
3. Scroll down to the end of the "Build and Deploy" section until you find the "
Deploy Hook"
4. Copy this value
5. Open your new Maybe app, click your profile, click "Self Host Settings"
6. Paste your deploy hook in the settings and save
7. You're all set!
#### Step 3 (IMPORTANT!!!): Upgrade your Render services
By default, we set you up with a FREE Render web service and a FREE postgres
database. We do this for a few reasons:
- It allows you to take self-hosted Maybe for a FREE test-drive
- It prevents newcomers from incurring unexpected hosting charges
##### Upgrade your Database (REQUIRED)
All FREE Render databases **will be deleted after a few months**. This means
that **you will lose all of your Maybe data**.
**To avoid losing data, you MUST upgrade your Render database** (a "starter"
instance is $7/month)
You can upgrade your instance directly in the Render dashboard.
##### Upgrade your Web Service (RECOMMENDED)
All FREE Render web services use a small amount of memory and "sleep" after
periods of inactivity.
For the _fastest_ Maybe experience, you should upgrade your web service (a "
starter" instance is $7/month)