refactor: separate migrations from API runtime
This commit is contained in:
+15
-1
@@ -51,6 +51,8 @@ services:
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
minio:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
@@ -61,6 +63,18 @@ services:
|
||||
timeout: 3s
|
||||
retries: 12
|
||||
|
||||
migrate:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/api/Dockerfile
|
||||
environment:
|
||||
DATABASE_URL: postgresql+psycopg://rf4:rf4_local@db:5432/rf4_spotter
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
command: ["alembic", "upgrade", "head"]
|
||||
restart: "no"
|
||||
|
||||
web:
|
||||
build: ./apps/web
|
||||
environment:
|
||||
@@ -87,7 +101,7 @@ services:
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
command: ["sh", "-c", "alembic upgrade head && python -m app.cli import-records"]
|
||||
command: ["python", "-m", "app.cli", "import-records"]
|
||||
|
||||
scheduler:
|
||||
build:
|
||||
|
||||
Reference in New Issue
Block a user