GeniePy supports deployments to Fly.io using a Docker container based workflow.
A Dockerfile
is included in the boilerplate and is configured to run the
frontend and backend processes, and an nginx process that acts like a proxy to
handle requests based on the URL path. All three processes are kept up and
running using the Supervisor process manager.
1. Prerequisites
If you haven't already, install flyctl on your machine and login using fly auth login
.
2. Setup
Fly.io supports deploying applications using a fly.toml launch configuration file.
GeniePy includes a basic fly.toml which you can adjust for your use case. Open it up in your text editor and adjust the "name" and "region" settings to your choosing.
Next, run fly launch
to launch the application.
3. Configuration
Set the following environment variables before the first deployment:
$ flyctl secrets set \
STRIPE_WEBHOOK_SECRET=value \
STRIPE_API_KEY=value \
CLERK_SECRET_KEY=value \
CLERK_PUBLISHABLE_KEY=value \
CLERK_INSTANCE_URL=value \
API_URL=https://example.com
4. Deploy
Run fly deploy
to deploy your code. 🥳
5. Custom Domain
If you would like to use a custom domain for your application, there are two further steps to perform:
- Add "A"/"AAAA" DNS records to point to your domain.
- Add SSL certificates to make sure your site loads using HTTPS.
All done! Check your Fly.io dashboard for more details on the app you just launched.