Some checks failed
Pull Request Checks / Validate PR (pull_request) Has been cancelled
Deploy to Coolify / Code Quality (pull_request) Has been cancelled
Deploy to Coolify / Run Tests (pull_request) Has been cancelled
Deploy to Coolify / Deploy to Development (pull_request) Has been cancelled
Deploy to Coolify / Deploy to Production (pull_request) Has been cancelled
Deploy to Coolify / Deploy to Test (pull_request) Has been cancelled
Complete local dev environment for testing: **Docker Compose Stack:** - PostgreSQL 15 (Supabase) - GoTrue (Auth service) - PostgREST (Auto-generated API) - Kong (API Gateway) - Realtime (WebSocket subscriptions) - Storage API (S3-compatible) - Supabase Studio (Admin UI on :54323) **Configuration:** - Kong routing config for all Supabase services - Environment variables with example JWT/API keys - Auto-apply migrations on first startup - Persistent volumes for data **Documentation:** - DEV_SETUP.md with step-by-step guide - Troubleshooting section - Common tasks (reset DB, view logs, etc.) - Pre-seeded data reference **Bonus:** - BarcodeScanner.vue component (Week 3 preview) - html5-qrcode library installed Ready to run: `docker-compose up -d && cd app && bun run dev` Access: - App: http://localhost:3000 - Supabase API: http://localhost:54321 - Supabase Studio: http://localhost:54323 - PostgreSQL: localhost:5432
128 lines
3.5 KiB
YAML
128 lines
3.5 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# PostgreSQL Database
|
|
db:
|
|
image: supabase/postgres:15.1.0.147
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
|
POSTGRES_DB: postgres
|
|
volumes:
|
|
- db-data:/var/lib/postgresql/data
|
|
- ./supabase/migrations:/docker-entrypoint-initdb.d:ro
|
|
|
|
# Supabase Studio (Admin UI)
|
|
studio:
|
|
image: supabase/studio:20231123-64a766a
|
|
restart: unless-stopped
|
|
ports:
|
|
- "54323:3000"
|
|
environment:
|
|
SUPABASE_URL: http://kong:8000
|
|
SUPABASE_PUBLIC_URL: http://localhost:54321
|
|
SUPABASE_ANON_KEY: ${ANON_KEY}
|
|
SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY}
|
|
|
|
# Kong API Gateway
|
|
kong:
|
|
image: kong:2.8.1
|
|
restart: unless-stopped
|
|
ports:
|
|
- "54321:8000"
|
|
- "54320:8443"
|
|
environment:
|
|
KONG_DATABASE: "off"
|
|
KONG_DECLARATIVE_CONFIG: /var/lib/kong/kong.yml
|
|
KONG_DNS_ORDER: LAST,A,CNAME
|
|
KONG_PLUGINS: request-transformer,cors,key-auth,acl
|
|
volumes:
|
|
- ./docker/kong.yml:/var/lib/kong/kong.yml:ro
|
|
|
|
# GoTrue (Auth)
|
|
auth:
|
|
image: supabase/gotrue:v2.99.0
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- db
|
|
environment:
|
|
GOTRUE_API_HOST: 0.0.0.0
|
|
GOTRUE_API_PORT: 9999
|
|
API_EXTERNAL_URL: http://localhost:54321
|
|
GOTRUE_DB_DRIVER: postgres
|
|
GOTRUE_DB_DATABASE_URL: postgres://supabase_auth_admin:${POSTGRES_PASSWORD:-postgres}@db:5432/postgres
|
|
GOTRUE_SITE_URL: http://localhost:3000
|
|
GOTRUE_URI_ALLOW_LIST: "*"
|
|
GOTRUE_DISABLE_SIGNUP: false
|
|
GOTRUE_JWT_ADMIN_ROLES: service_role
|
|
GOTRUE_JWT_AUD: authenticated
|
|
GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated
|
|
GOTRUE_JWT_EXP: 3600
|
|
GOTRUE_JWT_SECRET: ${JWT_SECRET}
|
|
GOTRUE_EXTERNAL_EMAIL_ENABLED: true
|
|
GOTRUE_MAILER_AUTOCONFIRM: true
|
|
|
|
# PostgREST (Auto API)
|
|
rest:
|
|
image: postgrest/postgrest:v11.2.0
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- db
|
|
environment:
|
|
PGRST_DB_URI: postgres://authenticator:${POSTGRES_PASSWORD:-postgres}@db:5432/postgres
|
|
PGRST_DB_SCHEMAS: public,storage
|
|
PGRST_DB_ANON_ROLE: anon
|
|
PGRST_JWT_SECRET: ${JWT_SECRET}
|
|
PGRST_DB_USE_LEGACY_GUCS: "false"
|
|
|
|
# Realtime
|
|
realtime:
|
|
image: supabase/realtime:v2.25.35
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- db
|
|
environment:
|
|
PORT: 4000
|
|
DB_HOST: db
|
|
DB_PORT: 5432
|
|
DB_USER: supabase_admin
|
|
DB_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
|
DB_NAME: postgres
|
|
DB_AFTER_CONNECT_QUERY: 'SET search_path TO _realtime'
|
|
DB_ENC_KEY: supabaserealtime
|
|
API_JWT_SECRET: ${JWT_SECRET}
|
|
FLY_ALLOC_ID: fly123
|
|
FLY_APP_NAME: realtime
|
|
SECRET_KEY_BASE: ${JWT_SECRET}
|
|
ERL_AFLAGS: -proto_dist inet_tcp
|
|
ENABLE_TAILSCALE: "false"
|
|
DNS_NODES: "''"
|
|
|
|
# Storage (S3-compatible)
|
|
storage:
|
|
image: supabase/storage-api:v0.40.4
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- db
|
|
- rest
|
|
environment:
|
|
ANON_KEY: ${ANON_KEY}
|
|
SERVICE_KEY: ${SERVICE_ROLE_KEY}
|
|
POSTGREST_URL: http://rest:3000
|
|
PGRST_JWT_SECRET: ${JWT_SECRET}
|
|
DATABASE_URL: postgres://supabase_storage_admin:${POSTGRES_PASSWORD:-postgres}@db:5432/postgres
|
|
FILE_SIZE_LIMIT: 52428800
|
|
STORAGE_BACKEND: file
|
|
FILE_STORAGE_BACKEND_PATH: /var/lib/storage
|
|
TENANT_ID: stub
|
|
REGION: stub
|
|
GLOBAL_S3_BUCKET: stub
|
|
volumes:
|
|
- storage-data:/var/lib/storage
|
|
|
|
volumes:
|
|
db-data:
|
|
storage-data:
|