Add BASE_URL environment variable

When running a Docker deployment, we need a way to set the app's base
URL. Otherwise links in emails, or generated in jobs etc., can not be
correctly constructed.
This commit is contained in:
Kevin McConnell
2025-12-19 12:14:15 +00:00
parent f9409c15a0
commit 407f2a3a6a
4 changed files with 23 additions and 0 deletions
+10
View File
@@ -90,6 +90,15 @@ Less commonly, you might also need to set some of the following:
You can find out more about all these settings in the [Rails Action Mailer documentation](https://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration).
#### Base URL
Fizzy needs to know the public URL of your instance so it can generate correct links in certain situations (like when sending emails).
Set `BASE_URL` to the full URL where your Fizzy instance is accessible:
```sh
docker run --environment BASE_URL=https://fizzy.example.com ...
```
#### VAPID keys
Fizzy can also send Web Push notifications.
@@ -153,6 +162,7 @@ services:
environment:
- SECRET_KEY_BASE=abcdefabcdef
- TLS_DOMAIN=fizzy.example.com
- BASE_URL=https://fizzy.example.com
- MAILER_FROM_ADDRESS=fizzy@example.com
- SMTP_ADDRESS=mail.example.com
- SMTP_USERNAME=user
+1
View File
@@ -33,6 +33,7 @@ We've added comments to that file to highlight what each setting needs to be, bu
- `servers/web`: Enter the hostname of the server you're deploying to here. This should be an address that you can access via `ssh`.
- `ssh/user`: If you access your server a `root` you can leave this alone; if you use a different user, set it here.
- `proxy/ssl` and `proxy/host`: Kamal can set up SSL certificates for you automatically. To enable that, set the hostname again as `host`. If you don't want SSL for some reason, you can set `ssl: false` to turn it off.
- `env/clear/BASE_URL`: The public URL of your Fizzy instance (e.g., `https://fizzy.example.com`). Used when generating links.
- `env/clear/MAILER_FROM_ADDRESS`: This is the email address that Fizzy will send emails from. It should usually be an address from the same domain where you're running Fizzy.
- `env/clear/SMTP_ADDRESS`: The address of an SMTP server that you can send email through. You can use a 3rd-party service for this, like Sendgrid or Postmark, in which case their documentation will tell you what to use for this.
- `env/clear/MULTI_TENANT`: Set to `true` if you want to allow multiple accounts to sign up on your server (by default, Fizzy will allow you to create a single account).