This repo is the self-hosted Supabase backend for Giftamizer — Postgres, Auth, Storage, Realtime, Edge Functions, and a handful of Giftamizer-specific services, all run via Docker Compose. It's based on the official Supabase self-hosting Docker guide.
- Docker and Docker Compose v2
- Git
cp .env.example .env
docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml up -dThis starts the full Supabase stack plus dev conveniences:
- Studio / API gateway — http://localhost:8000 (basic auth:
DASHBOARD_USERNAME/DASHBOARD_PASSWORDfrom.env) - Inbucket (fake mail server) — http://localhost:9000, catches all auth emails so you don't need real SMTP locally
- Postgres Meta — exposed on
localhost:5555for direct DB introspection tools
The Giftamizer schema (profiles, groups, items, lists, RLS policies,
storage buckets, etc.) is created automatically from
volumes/db/giftamizer/*.sql the first time the db container initializes
an empty data directory. Sign up through the app (or Studio's Auth panel) to
create a user — the handle_new_user trigger sets up their profile and
default list automatically.
Stop the stack with:
docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml downTo wipe everything (containers, volumes, and your local .env) and start
completely fresh:
./reset.shProduction also runs three Giftamizer-specific containers: smtp2graph
(SMTP-to-Microsoft-Graph email relay), urlmetadata (link preview
metadata), and firebase-auth-middleware (legacy Firebase password
verification). These are not started by default locally since they need
Azure AD / Firebase credentials. To opt in:
echo "COMPOSE_PROFILES=giftamizer-extras" >> .env
docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml up -dTo test with S3-compatible storage (MinIO) instead of the local filesystem:
docker compose -f docker-compose.yml -f docker-compose.s3.yml up -ddocker-compose.yml— the full stack; this is also what production runsdev/docker-compose.dev.yml— local dev overrides (fake mail server, fresh DB volume, exposed meta port)docker-compose.s3.yml— optional MinIO-backed storage overridevolumes/db/— Postgres init scripts, run once against an empty database:roles.sql,jwt.sql,webhooks.sql,logs.sql,pooler.sql,realtime.sql,_supabase.sql— stock Supabase setupgiftamizer/00NN-*.sql— Giftamizer's application schema, run in numeric order (see below)
volumes/api/kong.yml— API gateway routingvolumes/functions/— Edge Functions (Deno)dev/data.sql— optional local dev seed data (empty by default)
docker-entrypoint-initdb.d scripts (everything under volumes/db/) only
run once, against a brand-new empty Postgres data directory — they will
not apply to the already-running production database. To ship a schema
change to production:
- Write a new file,
volumes/db/giftamizer/00NN-description.sql, describing the change. - Test it locally: reset your local stack (
./reset.sh) and confirm the full script set applies cleanly, including your new file. - Apply the same SQL by hand to production (via the Studio SQL editor or
psql). - Commit the new file. This keeps fresh installs (local dev, disaster recovery) in sync with what's actually live, since the numbered scripts are both the historical record and the fresh-install source of truth.
For non-schema changes (new image versions, compose config, etc.), edit
docker-compose.yml directly, test locally, then on the server run
docker compose pull followed by docker compose up -d for the affected
service(s).