Split databases and Redis — prepare infrastructure for per-domain isolation
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m20s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m20s
Redis: per-app DB index (0-5) with shared auth DB 15 for SSO keys; flushdb replaces flushall so deploys don't wipe cross-app auth state. Postgres: drop 13 cross-domain FK constraints (migration v2t0p8q9r0), remove dead ORM relationships, add explicit joins for 4 live ones. Multi-engine sessions (account + federation) ready for per-domain DBs via DATABASE_URL_ACCOUNT / DATABASE_URL_FEDERATION env vars. All URLs initially point to the same appdb — zero behaviour change until split-databases.sh is run to migrate data to per-domain DBs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,8 @@ x-app-common: &app-common
|
||||
|
||||
x-app-env: &app-env
|
||||
DATABASE_URL: postgresql+asyncpg://postgres:change-me@db:5432/appdb
|
||||
DATABASE_URL_ACCOUNT: postgresql+asyncpg://postgres:change-me@db:5432/appdb
|
||||
DATABASE_URL_FEDERATION: postgresql+asyncpg://postgres:change-me@db:5432/appdb
|
||||
ALEMBIC_DATABASE_URL: postgresql+psycopg://postgres:change-me@db:5432/appdb
|
||||
SMTP_HOST: ${SMTP_HOST}
|
||||
SMTP_PORT: ${SMTP_PORT}
|
||||
@@ -23,7 +25,7 @@ x-app-env: &app-env
|
||||
GHOST_CONTENT_API_KEY: ${GHOST_CONTENT_API_KEY}
|
||||
GHOST_WEBHOOK_SECRET: ${GHOST_WEBHOOK_SECRET}
|
||||
GHOST_ADMIN_API_KEY: ${GHOST_ADMIN_API_KEY}
|
||||
REDIS_URL: redis://redis:6379
|
||||
REDIS_AUTH_URL: redis://redis:6379/15
|
||||
SECRET_KEY: ${SECRET_KEY}
|
||||
SUMUP_API_KEY: ${SUMUP_API_KEY}
|
||||
APP_URL_BLOG: https://blog.rose-ash.com
|
||||
@@ -56,6 +58,7 @@ services:
|
||||
dockerfile: blog/Dockerfile
|
||||
environment:
|
||||
<<: *app-env
|
||||
REDIS_URL: redis://redis:6379/0
|
||||
DATABASE_HOST: db
|
||||
DATABASE_PORT: "5432"
|
||||
RUN_MIGRATIONS: "true"
|
||||
@@ -71,6 +74,7 @@ services:
|
||||
- /root/rose-ash/_snapshot:/app/_snapshot
|
||||
environment:
|
||||
<<: *app-env
|
||||
REDIS_URL: redis://redis:6379/1
|
||||
DATABASE_HOST: db
|
||||
DATABASE_PORT: "5432"
|
||||
|
||||
@@ -82,6 +86,7 @@ services:
|
||||
dockerfile: cart/Dockerfile
|
||||
environment:
|
||||
<<: *app-env
|
||||
REDIS_URL: redis://redis:6379/2
|
||||
DATABASE_HOST: db
|
||||
DATABASE_PORT: "5432"
|
||||
|
||||
@@ -93,6 +98,7 @@ services:
|
||||
dockerfile: events/Dockerfile
|
||||
environment:
|
||||
<<: *app-env
|
||||
REDIS_URL: redis://redis:6379/3
|
||||
DATABASE_HOST: db
|
||||
DATABASE_PORT: "5432"
|
||||
|
||||
@@ -104,6 +110,7 @@ services:
|
||||
dockerfile: federation/Dockerfile
|
||||
environment:
|
||||
<<: *app-env
|
||||
REDIS_URL: redis://redis:6379/4
|
||||
DATABASE_HOST: db
|
||||
DATABASE_PORT: "5432"
|
||||
|
||||
@@ -115,6 +122,7 @@ services:
|
||||
dockerfile: account/Dockerfile
|
||||
environment:
|
||||
<<: *app-env
|
||||
REDIS_URL: redis://redis:6379/5
|
||||
DATABASE_HOST: db
|
||||
DATABASE_PORT: "5432"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user