2.2 KiB
Coolify — Add a Supabase project
Each Supabase "project" in Coolify is a Docker Compose stack containing Postgres + GoTrue + PostgREST + Storage + Realtime + Studio + Kong. They are fully isolated.
Create the disclosure project
-
Coolify dashboard → + New Resource → Service → search "Supabase" → Deploy.
-
Configure:
- Project name:
disclosure - Server: your VPS (it's the default if you only have one)
- Domain:
db.disclosure.top(the Kong API gateway will live here) - Studio domain:
studio.disclosure.top(the admin UI)
- Project name:
-
Coolify generates the secrets automatically. Copy these for later:
POSTGRES_PASSWORDJWT_SECRETANON_KEYSERVICE_ROLE_KEYDASHBOARD_USERNAME/DASHBOARD_PASSWORD(for Studio basic auth)
-
Click Deploy. Coolify pulls all images and starts the stack (~3 min).
-
When green: open
https://studio.disclosure.top, log in with the dashboard creds.
Apply the chat schema
In Studio → SQL Editor, paste the contents of ../supabase/migrations/0001_chat_schema.sql and run. This creates profiles, chat_sessions, messages with RLS enabled.
Then run ../supabase/seed.sql to seed your admin user (edit the email in the file first).
Verify
# From your laptop, with the ANON_KEY copied from Coolify:
curl -H "apikey: <ANON_KEY>" https://db.disclosure.top/rest/v1/profiles
# → [] (empty array, but valid response = it's working)
Adding another project later
Same flow — Coolify → + New Service → Supabase. Pick a new project name (projeto-b), new domains (db.projeto-b.com, studio.projeto-b.com). Coolify isolates everything: own Postgres, own GoTrue, own secrets. Different anon/service keys.
Resource tuning
In each Supabase project's stack settings, increase Postgres memory if needed:
# In the Postgres service env vars:
POSTGRES_SHARED_BUFFERS: 256MB
POSTGRES_WORK_MEM: 16MB
POSTGRES_MAINTENANCE_WORK_MEM: 64MB
Defaults are fine for <10k users. For chat-heavy workloads bump shared_buffers.
Next
→ NEXTJS.md — deploy the web app