Unraid's Compose Manager stopped at "pull access denied for brokeless". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
171 lines
6.1 KiB
YAML
171 lines
6.1 KiB
YAML
# brokeless: broke with everything it needs, all on your own server. See README.md in this folder.
|
|
# node docker/setup.mjs --url http://192.168.1.10:3001 (once: writes docker/.env with fresh secrets)
|
|
# docker compose -f docker/docker-compose.yml up -d --build
|
|
# ... --profile ai up -d (also runs Ollama for local AI)
|
|
#
|
|
# Supabase parts (db, auth, rest) follow Supabase's own self-hosting setup, cut down to what broke uses.
|
|
|
|
name: brokeless
|
|
|
|
x-hardening: &hardening
|
|
restart: unless-stopped
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
|
|
services:
|
|
# The only port you open: broke and its Supabase API on one address.
|
|
gateway:
|
|
<<: *hardening
|
|
image: nginx:1.28-alpine
|
|
ports:
|
|
- "${HTTP_PORT:-3001}:80"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
depends_on:
|
|
- broke
|
|
- auth
|
|
- rest
|
|
|
|
broke:
|
|
<<: *hardening
|
|
build:
|
|
context: ..
|
|
args:
|
|
NEXT_PUBLIC_SUPABASE_URL: ${PUBLIC_URL}
|
|
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY: ${ANON_KEY}
|
|
image: brokeless:local
|
|
# Built from this repo, never downloaded (it isn't in any registry). Rebuilt on each up, so code changes get in.
|
|
pull_policy: build
|
|
cap_drop: [ALL]
|
|
environment:
|
|
NEXT_PUBLIC_SUPABASE_URL: ${PUBLIC_URL}
|
|
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY: ${ANON_KEY}
|
|
# No calls out: no update check, no exchange rates. Set to 0 for rates across currencies (frankfurter.dev).
|
|
BROKE_OFFLINE: ${BROKE_OFFLINE:-1}
|
|
SUPABASE_SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY}
|
|
# Inside the stack only, so no SSL (broke turns SSL on unless the URL says otherwise).
|
|
SUPABASE_DB_URL: postgresql://postgres:${POSTGRES_PASSWORD}@db:5432/postgres?sslmode=disable
|
|
LOCAL_LLM_BASE_URL: ${LOCAL_LLM_BASE_URL:-http://ollama:11434/v1}
|
|
LOCAL_LLM_MODEL: ${LOCAL_LLM_MODEL:-}
|
|
PLAID_CLIENT_ID: ${PLAID_CLIENT_ID:-}
|
|
PLAID_SECRET: ${PLAID_SECRET:-}
|
|
PLAID_ENV: ${PLAID_ENV:-sandbox}
|
|
PLAID_PRODUCTS: transactions
|
|
PLAID_COUNTRY_CODES: ${PLAID_COUNTRY_CODES:-US}
|
|
# broke's server calls Supabase at PUBLIC_URL too, so the server must be able to reach its own address.
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
auth:
|
|
condition: service_healthy
|
|
|
|
db:
|
|
<<: *hardening
|
|
image: supabase/postgres:17.6.1.136
|
|
volumes:
|
|
- ./db/roles.sql:/docker-entrypoint-initdb.d/init-scripts/99-roles.sql:ro
|
|
- ./db/jwt.sql:/docker-entrypoint-initdb.d/init-scripts/99-jwt.sql:ro
|
|
- ${DATA_DIR:-./data}/db:/var/lib/postgresql/data
|
|
- db-config:/etc/postgresql-custom
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready", "-U", "postgres", "-h", "localhost"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
environment:
|
|
POSTGRES_HOST: /var/run/postgresql
|
|
PGPORT: 5432
|
|
POSTGRES_PORT: 5432
|
|
PGPASSWORD: ${POSTGRES_PASSWORD}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
PGDATABASE: postgres
|
|
POSTGRES_DB: postgres
|
|
JWT_EXP: 3600
|
|
command: ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf", "-c", "log_min_messages=fatal"]
|
|
|
|
auth:
|
|
<<: *hardening
|
|
image: supabase/gotrue:v2.197.0
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9999/health"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
GOTRUE_API_HOST: 0.0.0.0
|
|
GOTRUE_API_PORT: 9999
|
|
API_EXTERNAL_URL: ${PUBLIC_URL}/auth/v1
|
|
GOTRUE_DB_DRIVER: postgres
|
|
GOTRUE_DB_DATABASE_URL: postgres://supabase_auth_admin:${POSTGRES_PASSWORD}@db:5432/postgres
|
|
GOTRUE_SITE_URL: ${PUBLIC_URL}
|
|
GOTRUE_URI_ALLOW_LIST: ${PUBLIC_URL}/**
|
|
# Set DISABLE_SIGNUP=true in .env after your first sign-in, so nobody else can make an account.
|
|
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: 3600
|
|
GOTRUE_JWT_SECRET: ${JWT_SECRET}
|
|
GOTRUE_JWT_ISSUER: ${PUBLIC_URL}/auth/v1
|
|
GOTRUE_EXTERNAL_EMAIL_ENABLED: "true"
|
|
GOTRUE_EXTERNAL_ANONYMOUS_USERS_ENABLED: "false"
|
|
GOTRUE_EXTERNAL_PHONE_ENABLED: "false"
|
|
GOTRUE_MAILER_AUTOCONFIRM: "false"
|
|
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
|
|
# Sign-in links go to Mailpit below by default. Point these at a real mail server to get them in your inbox.
|
|
GOTRUE_SMTP_HOST: ${SMTP_HOST:-mailpit}
|
|
GOTRUE_SMTP_PORT: ${SMTP_PORT:-1025}
|
|
GOTRUE_SMTP_USER: ${SMTP_USER:-}
|
|
GOTRUE_SMTP_PASS: ${SMTP_PASS:-}
|
|
GOTRUE_SMTP_ADMIN_EMAIL: ${SMTP_FROM:-broke@broke.local}
|
|
GOTRUE_SMTP_SENDER_NAME: broke
|
|
|
|
rest:
|
|
<<: *hardening
|
|
image: postgrest/postgrest:v14.18
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
PGRST_DB_URI: postgres://authenticator:${POSTGRES_PASSWORD}@db:5432/postgres
|
|
PGRST_DB_SCHEMAS: public
|
|
PGRST_DB_MAX_ROWS: 1000
|
|
PGRST_DB_EXTRA_SEARCH_PATH: public
|
|
PGRST_DB_ANON_ROLE: anon
|
|
PGRST_JWT_SECRET: ${JWT_SECRET}
|
|
PGRST_DB_USE_LEGACY_GUCS: "false"
|
|
PGRST_APP_SETTINGS_JWT_EXP: 3600
|
|
command: ["postgrest"]
|
|
|
|
# Catches sign-in emails. Open http://<server>:8025 (user "broke", MAIL_PASSWORD from .env) to click your link.
|
|
mailpit:
|
|
<<: *hardening
|
|
image: axllent/mailpit:v1.27
|
|
ports:
|
|
- "${MAIL_UI_PORT:-8025}:8025"
|
|
environment:
|
|
MP_UI_AUTH: broke:${MAIL_PASSWORD}
|
|
MP_MAX_MESSAGES: 200
|
|
|
|
# Local AI, full detail stays here. Start with --profile ai, then: docker exec brokeless-ollama-1 ollama pull <model>
|
|
ollama:
|
|
<<: *hardening
|
|
image: ollama/ollama:latest
|
|
profiles: [ai]
|
|
volumes:
|
|
- ${DATA_DIR:-./data}/ollama:/root/.ollama
|
|
# For an Nvidia GPU on Unraid (Nvidia Driver plugin), uncomment:
|
|
# deploy:
|
|
# resources:
|
|
# reservations:
|
|
# devices: [{ driver: nvidia, count: all, capabilities: [gpu] }]
|
|
|
|
volumes:
|
|
db-config:
|