db: initial migration + container başlangıcında otomatik migrate deploy

Postgres canlıydı ama şema hiç uygulanmamıştı (migrations/ klasörü boştu).
Bu ortamdan Coolify'ın Postgres'ine ağ erişimi yok (5432 filtreli), bu yüzden
`prisma migrate dev` yerine offline schema diff (`migrate diff --from-empty`)
ile ilk migration SQL'i üretildi. api-daemon container'ı artık başlarken
`prisma migrate deploy` çalıştırıyor. Tüm servislere restart: unless-stopped
eklendi ki Postgres henüz hazır değilken başlayan container kendini toparlasın.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-30 14:58:34 +03:00
co-authored by Claude Sonnet 5
parent 8ae34c18ef
commit 0374846cc1
4 changed files with 82 additions and 1 deletions
+5
View File
@@ -1,6 +1,7 @@
services:
sc_redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"
volumes:
@@ -8,6 +9,7 @@ services:
sc_postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: streamclipper
POSTGRES_PASSWORD: streamclipper
@@ -21,6 +23,7 @@ services:
build:
context: .
dockerfile: apps/api-daemon/Dockerfile
restart: unless-stopped
environment:
REDIS_URL: redis://sc_redis:6379
DATABASE_URL: postgresql://streamclipper:streamclipper@sc_postgres:5432/streamclipper
@@ -43,6 +46,7 @@ services:
build:
context: .
dockerfile: apps/worker/Dockerfile
restart: unless-stopped
environment:
REDIS_URL: redis://sc_redis:6379
DATABASE_URL: postgresql://streamclipper:streamclipper@sc_postgres:5432/streamclipper
@@ -61,6 +65,7 @@ services:
build:
context: .
dockerfile: apps/frontend/Dockerfile
restart: unless-stopped
environment:
DATABASE_URL: postgresql://streamclipper:streamclipper@sc_postgres:5432/streamclipper
ports: