202 lines
6.2 KiB
YAML
202 lines
6.2 KiB
YAML
version: '3.8'
|
|
|
|
# Full self-hosted deployment with Supabase included
|
|
# This includes PostgreSQL, Auth, REST API, and the Deckerr frontend
|
|
|
|
services:
|
|
# ============================================
|
|
# DECKERR FRONTEND
|
|
# ============================================
|
|
deckerr:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
args:
|
|
- VITE_SUPABASE_URL=http://${SITE_URL:-localhost}:${KONG_HTTP_PORT:-8000}
|
|
- VITE_SUPABASE_ANON_KEY=${ANON_KEY}
|
|
container_name: deckerr
|
|
ports:
|
|
- "${DECKERR_PORT:-3000}:80"
|
|
restart: unless-stopped
|
|
depends_on:
|
|
kong:
|
|
condition: service_healthy
|
|
|
|
# ============================================
|
|
# SUPABASE SERVICES
|
|
# ============================================
|
|
|
|
# PostgreSQL Database
|
|
db:
|
|
image: supabase/postgres:15.1.1.78
|
|
container_name: supabase-db
|
|
healthcheck:
|
|
test: pg_isready -U postgres -h localhost
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
ports:
|
|
- "${POSTGRES_PORT:-5432}:5432"
|
|
environment:
|
|
POSTGRES_HOST: /var/run/postgresql
|
|
PGPORT: 5432
|
|
POSTGRES_PORT: 5432
|
|
PGPASSWORD: ${POSTGRES_PASSWORD}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
PGDATABASE: postgres
|
|
POSTGRES_DB: postgres
|
|
volumes:
|
|
- supabase-db-data:/var/lib/postgresql/data
|
|
- ./supabase/migrations:/docker-entrypoint-initdb.d/migrations
|
|
restart: unless-stopped
|
|
|
|
# Supabase Kong API Gateway
|
|
kong:
|
|
image: kong:2.8.1
|
|
container_name: supabase-kong
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${KONG_HTTP_PORT:-8000}:8000/tcp"
|
|
- "${KONG_HTTPS_PORT:-8443}:8443/tcp"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
KONG_DATABASE: "off"
|
|
KONG_DECLARATIVE_CONFIG: /home/kong/kong.yml
|
|
KONG_DNS_ORDER: LAST,A,CNAME
|
|
KONG_PLUGINS: request-transformer,cors,key-auth,acl,basic-auth
|
|
KONG_NGINX_PROXY_PROXY_BUFFER_SIZE: 160k
|
|
KONG_NGINX_PROXY_PROXY_BUFFERS: 64 160k
|
|
SUPABASE_ANON_KEY: ${ANON_KEY}
|
|
SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY}
|
|
volumes:
|
|
- ./docker/kong.yml:/home/kong/kong.yml:ro
|
|
healthcheck:
|
|
test: ["CMD", "kong", "health"]
|
|
interval: 10s
|
|
timeout: 10s
|
|
retries: 5
|
|
|
|
# Supabase Auth (GoTrue)
|
|
auth:
|
|
image: supabase/gotrue:v2.143.0
|
|
container_name: supabase-auth
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9999/health"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
environment:
|
|
GOTRUE_API_HOST: 0.0.0.0
|
|
GOTRUE_API_PORT: 9999
|
|
API_EXTERNAL_URL: ${API_EXTERNAL_URL:-http://localhost:8000}
|
|
|
|
GOTRUE_DB_DRIVER: postgres
|
|
GOTRUE_DB_DATABASE_URL: postgres://supabase_auth_admin:${POSTGRES_PASSWORD}@db:5432/postgres
|
|
|
|
GOTRUE_SITE_URL: ${SITE_URL:-http://localhost:3000}
|
|
GOTRUE_URI_ALLOW_LIST: ${ADDITIONAL_REDIRECT_URLS:-}
|
|
GOTRUE_DISABLE_SIGNUP: ${DISABLE_SIGNUP:-false}
|
|
|
|
GOTRUE_JWT_ADMIN_ROLES: service_role
|
|
GOTRUE_JWT_AUD: authenticated
|
|
GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated
|
|
GOTRUE_JWT_EXP: ${JWT_EXPIRY:-3600}
|
|
GOTRUE_JWT_SECRET: ${JWT_SECRET}
|
|
|
|
GOTRUE_EXTERNAL_EMAIL_ENABLED: ${ENABLE_EMAIL_SIGNUP:-true}
|
|
GOTRUE_EXTERNAL_ANONYMOUS_USERS_ENABLED: ${ENABLE_ANONYMOUS_USERS:-false}
|
|
GOTRUE_MAILER_AUTOCONFIRM: ${ENABLE_EMAIL_AUTOCONFIRM:-false}
|
|
|
|
GOTRUE_SMTP_HOST: ${SMTP_HOST:-}
|
|
GOTRUE_SMTP_PORT: ${SMTP_PORT:-587}
|
|
GOTRUE_SMTP_USER: ${SMTP_USER:-}
|
|
GOTRUE_SMTP_PASS: ${SMTP_PASS:-}
|
|
GOTRUE_SMTP_ADMIN_EMAIL: ${SMTP_ADMIN_EMAIL:-}
|
|
GOTRUE_SMTP_SENDER_NAME: ${SMTP_SENDER_NAME:-Deckerr}
|
|
GOTRUE_MAILER_URLPATHS_INVITE: /auth/v1/verify
|
|
GOTRUE_MAILER_URLPATHS_CONFIRMATION: /auth/v1/verify
|
|
GOTRUE_MAILER_URLPATHS_RECOVERY: /auth/v1/verify
|
|
GOTRUE_MAILER_URLPATHS_EMAIL_CHANGE: /auth/v1/verify
|
|
|
|
# Supabase REST API (PostgREST)
|
|
rest:
|
|
image: postgrest/postgrest:v12.0.1
|
|
container_name: supabase-rest
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
environment:
|
|
PGRST_DB_URI: postgres://authenticator:${POSTGRES_PASSWORD}@db:5432/postgres
|
|
PGRST_DB_SCHEMAS: ${PGRST_DB_SCHEMAS:-public,graphql_public}
|
|
PGRST_DB_ANON_ROLE: anon
|
|
PGRST_JWT_SECRET: ${JWT_SECRET}
|
|
PGRST_DB_USE_LEGACY_GUCS: "false"
|
|
PGRST_APP_SETTINGS_JWT_SECRET: ${JWT_SECRET}
|
|
PGRST_APP_SETTINGS_JWT_EXP: ${JWT_EXPIRY:-3600}
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:3000/ready || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
# Supabase Realtime
|
|
realtime:
|
|
image: supabase/realtime:v2.28.32
|
|
container_name: supabase-realtime
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-sSfL", "--head", "-o", "/dev/null", "-H", "Authorization: Bearer ${ANON_KEY}", "http://localhost:4000/api/tenants/realtime-dev/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
environment:
|
|
PORT: 4000
|
|
DB_HOST: db
|
|
DB_PORT: 5432
|
|
DB_USER: supabase_admin
|
|
DB_PASSWORD: ${POSTGRES_PASSWORD}
|
|
DB_NAME: postgres
|
|
DB_AFTER_CONNECT_QUERY: 'SET search_path TO _realtime'
|
|
DB_ENC_KEY: supabaserealtime
|
|
API_JWT_SECRET: ${JWT_SECRET}
|
|
SECRET_KEY_BASE: ${SECRET_KEY_BASE:-UpNVntn3cDxHJpq99YMc1T1AQgQpc8kfYTuRgBiYa15BLrx8etQoXz3gZv1/u2oq}
|
|
ERL_AFLAGS: -proto_dist inet_tcp
|
|
DNS_NODES: "''"
|
|
RLIMIT_NOFILE: "10000"
|
|
APP_NAME: realtime
|
|
SEED_SELF_HOST: true
|
|
REPLICATION_MODE: RLS
|
|
REPLICATION_POLL_INTERVAL: 100
|
|
SECURE_CHANNELS: "true"
|
|
SLOT_NAME: supabase_realtime_rls
|
|
TEMPORARY_SLOT: "true"
|
|
|
|
# Supabase Meta (for Studio - optional)
|
|
meta:
|
|
image: supabase/postgres-meta:v0.80.0
|
|
container_name: supabase-meta
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
environment:
|
|
PG_META_PORT: 8080
|
|
PG_META_DB_HOST: db
|
|
PG_META_DB_PORT: 5432
|
|
PG_META_DB_NAME: postgres
|
|
PG_META_DB_USER: supabase_admin
|
|
PG_META_DB_PASSWORD: ${POSTGRES_PASSWORD}
|
|
|
|
volumes:
|
|
supabase-db-data:
|