Run migrations before web startup
test / pytest (push) Successful in 1m22s

This commit is contained in:
2026-06-01 21:42:59 +02:00
parent 70b0cf08ee
commit e7ce562de6
+16 -5
View File
@@ -1,14 +1,25 @@
services: x-app-base: &app-base
web:
container_name: moving-helper
image: "code.wanderingbadger.dev/tliu93/2026-moving-helper:latest" image: "code.wanderingbadger.dev/tliu93/2026-moving-helper:latest"
build: build:
context: . context: .
user: "1000:1000" user: "1000:1000"
ports:
- "127.0.0.1:${APP_PORT:-10000}:10000"
environment: environment:
DATABASE_URL: ${DATABASE_URL:-sqlite:////app/data/app.db} DATABASE_URL: ${DATABASE_URL:-sqlite:////app/data/app.db}
volumes: volumes:
- ${DATA_DIR:-./data}:/app/data - ${DATA_DIR:-./data}:/app/data
services:
migrate:
<<: *app-base
command: ["python", "-m", "app.migrate"]
restart: "no"
web:
<<: *app-base
container_name: moving-helper
depends_on:
migrate:
condition: service_completed_successfully
ports:
- "127.0.0.1:${APP_PORT:-10000}:10000"
restart: unless-stopped restart: unless-stopped