Docker: fixes from a full test run

- roles.sql only touches roles this stack has (the init stopped early before)
- internal database link without SSL
- Mailpit without an SMTP login (GoTrue refuses one over plain SMTP)
- setup.mjs refuses localhost, which the containers can't reach

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MangaValkandClaude Opus 5.5 committed 2026-11-17 13:56:32 +01:00
1 parent c50c645cfb
commit 861e65021f
4 files changed
+12 -8

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@ Everything runs here: broke, its Postgres database, sign-in and the REST API (th
## First start ## First start
1. Pick the address you will open broke on, for example `http://192.168.1.10:3000` (your Unraid IP). Then make the secrets: 1. Pick the address you will open broke on, for example `http://192.168.1.10:3000` (your Unraid IP; not `localhost`, the containers need to reach it too). Then make the secrets:
```bash ```bash
node docker/setup.mjs --url http://192.168.1.10:3000 node docker/setup.mjs --url http://192.168.1.10:3000
+2 -2
View File
@@ -1,8 +1,8 @@
-- NOTE: change to your own passwords for production environments -- From Supabase's self-hosting setup (Apache-2.0), trimmed to the roles this stack runs.
-- Sets the internal roles' passwords to POSTGRES_PASSWORD.
\set pgpass `echo "$POSTGRES_PASSWORD"` \set pgpass `echo "$POSTGRES_PASSWORD"`
ALTER USER authenticator WITH PASSWORD :'pgpass'; ALTER USER authenticator WITH PASSWORD :'pgpass';
ALTER USER pgbouncer WITH PASSWORD :'pgpass'; ALTER USER pgbouncer WITH PASSWORD :'pgpass';
ALTER USER supabase_auth_admin WITH PASSWORD :'pgpass'; ALTER USER supabase_auth_admin WITH PASSWORD :'pgpass';
ALTER USER supabase_functions_admin WITH PASSWORD :'pgpass';
ALTER USER supabase_storage_admin WITH PASSWORD :'pgpass'; ALTER USER supabase_storage_admin WITH PASSWORD :'pgpass';
+4 -5
View File
@@ -39,7 +39,8 @@ services:
NEXT_PUBLIC_SUPABASE_URL: ${PUBLIC_URL} NEXT_PUBLIC_SUPABASE_URL: ${PUBLIC_URL}
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY: ${ANON_KEY} NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY: ${ANON_KEY}
SUPABASE_SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY} SUPABASE_SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY}
SUPABASE_DB_URL: postgresql://postgres:${POSTGRES_PASSWORD}@db:5432/postgres # 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_BASE_URL: ${LOCAL_LLM_BASE_URL:-http://ollama:11434/v1}
LOCAL_LLM_MODEL: ${LOCAL_LLM_MODEL:-} LOCAL_LLM_MODEL: ${LOCAL_LLM_MODEL:-}
PLAID_CLIENT_ID: ${PLAID_CLIENT_ID:-} PLAID_CLIENT_ID: ${PLAID_CLIENT_ID:-}
@@ -116,8 +117,8 @@ services:
# Sign-in links go to Mailpit below by default. Point these at a real mail server to get them in your inbox. # 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_HOST: ${SMTP_HOST:-mailpit}
GOTRUE_SMTP_PORT: ${SMTP_PORT:-1025} GOTRUE_SMTP_PORT: ${SMTP_PORT:-1025}
GOTRUE_SMTP_USER: ${SMTP_USER:-broke} GOTRUE_SMTP_USER: ${SMTP_USER:-}
GOTRUE_SMTP_PASS: ${SMTP_PASS:-broke} GOTRUE_SMTP_PASS: ${SMTP_PASS:-}
GOTRUE_SMTP_ADMIN_EMAIL: ${SMTP_FROM:-broke@broke.local} GOTRUE_SMTP_ADMIN_EMAIL: ${SMTP_FROM:-broke@broke.local}
GOTRUE_SMTP_SENDER_NAME: broke GOTRUE_SMTP_SENDER_NAME: broke
@@ -146,8 +147,6 @@ services:
- "${MAIL_UI_PORT:-8025}:8025" - "${MAIL_UI_PORT:-8025}:8025"
environment: environment:
MP_UI_AUTH: broke:${MAIL_PASSWORD} MP_UI_AUTH: broke:${MAIL_PASSWORD}
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
MP_MAX_MESSAGES: 200 MP_MAX_MESSAGES: 200
# Local AI, full detail stays here. Start with --profile ai, then: docker exec broke-ollama-1 ollama pull <model> # Local AI, full detail stays here. Start with --profile ai, then: docker exec broke-ollama-1 ollama pull <model>
+5
View File
@@ -14,6 +14,11 @@ if (!/^https?:\/\/[^/]+$/.test(url)) {
console.error("Give the address you will open broke on, with the port: node docker/setup.mjs --url http://192.168.1.10:3000"); console.error("Give the address you will open broke on, with the port: node docker/setup.mjs --url http://192.168.1.10:3000");
process.exit(1); process.exit(1);
} }
// broke's server reaches Supabase through this address too, and inside a container localhost is the container itself.
if (/^https?:\/\/(localhost|127\.|\[::1\]|0\.0\.0\.0)/.test(url)) {
console.error("Use the server's LAN address or name (like http://192.168.1.10:3000), not localhost: the containers can't reach localhost.");
process.exit(1);
}
if (existsSync(file) && !process.argv.includes("--force")) { if (existsSync(file) && !process.argv.includes("--force")) {
console.error(`${file} already exists. Its secrets protect your data, so it is left alone. Pass --force to replace it (only before first start).`); console.error(`${file} already exists. Its secrets protect your data, so it is left alone. Pass --force to replace it (only before first start).`);
process.exit(1); process.exit(1);