feat: separate migrator service for safe db initialization
This commit is contained in:
@@ -26,6 +26,15 @@ services:
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
migrator:
|
||||
build: .
|
||||
command: alembic upgrade head
|
||||
environment:
|
||||
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
api:
|
||||
build: .
|
||||
environment:
|
||||
@@ -37,6 +46,8 @@ services:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
migrator:
|
||||
condition: service_completed_successfully
|
||||
|
||||
nginx:
|
||||
image: nginx:1.25-alpine
|
||||
|
||||
Reference in New Issue
Block a user