An open API service indexing awesome lists of open source software.

https://github.com/nicholasoxford/supafly

The easiest way to deploy Supabase to Fly.io
https://github.com/nicholasoxford/supafly

flyio infastructure-as-code supabase

Last synced: 8 months ago
JSON representation

The easiest way to deploy Supabase to Fly.io

Awesome Lists containing this project

README

          

# SupaFly

This easiest way to deploy Supabase to Fly.io

## Features

- Uses new [Fly.io Apps v2](https://fly.io/docs/reference/apps/) platform
- Uses Fly's [private networking](https://fly.io/docs/reference/private-networking/)
> Applications within the same organization are assigned special addresses ("6PN addresses") tied to the organization. Those applications can talk to each other because of those 6PN addresses, but applications from other organizations can't; the Fly platform won't forward between different 6PN networks.
- Turborepo to make it easy to build off of

## Prerequisites

Run the following command:

- [x] Fly.io CLI tool installed
- [x] Wireguard installed
- [x] Add card to Fly.io account / organazation

### Install [flyctl](https://fly.io/docs/hands-on/install-flyctl/), or the Fly.io CLI tool

```sh
brew install flyctl
```

### [Wireguard Installation Instructions](https://www.wireguard.com/install/)

### We recommend creating a new organization for your SupaFly project

> If you don't pass in a value for `--org` it will default to your personal organization

## Deploying SupaFly

```sh
npx supafly@latest
```

PNG image

## Infrastructure Deployed

- Supabase flavor, postgres database
- [Postgres-meta](https://github.com/supabase/postgres-meta)
- [Supabase Auth Service](https://github.com/supabase/auth-helpers)
- [PostgREST](https://github.com/PostgREST/postgrest)
- [Api Gateway (kong)](https://docs.konghq.com/gateway/latest/production/deployment-topologies/db-less-and-declarative-config/)
- [Supabase Studio](https://github.com/supabase/supabase/tree/master/studio)

## Things to work on

- Supabase Storage Deployment
- Postgrest alpine image
- issues persisting data with database redeployments
- Pass in passwords for postgres roles
- Better name generation for Supabase services

[SupaFly Progress Tracker](https://github.com/users/nicholasoxford/projects/1/views/1)

## How I created this

- Got inspired by @kiwicopple [reddit comment](https://www.reddit.com/r/Supabase/comments/s9rdfd/globally_distributed_postgres_with_supabase/) about deploying Supabase DB to Fly
- Took the Supabase [docker-compose](https://github.com/supabase/supabase/blob/master/docker/docker-compose.yml) file and created fly services for each