services: migrator: image: mcr.microsoft.com/dotnet/sdk:10.0 working_dir: /src volumes: - ../..:/src environment: - App__ConnectionString=${CONNECTION_STRING} depends_on: db: condition: service_started command: - /bin/sh - -c - dotnet tool install --tool-path /tmp/dotnet-tools dotnet-ef --version "9.*" && until /tmp/dotnet-tools/dotnet-ef database update --project /src/HrynCo.NotificationService.DAL.EF --startup-project /src/HrynCo.NotificationService.Web; do echo "Migration failed, retrying in 3s..."; sleep 3; done restart: "no" api: build: context: ../.. dockerfile: HrynCo.NotificationService.Web/Dockerfile environment: - ASPNETCORE_ENVIRONMENT=Production - App__ConnectionString=${CONNECTION_STRING} ports: - "8080:8080" depends_on: db: condition: service_started migrator: condition: service_completed_successfully worker: build: context: ../.. dockerfile: HrynCo.NotificationService.Worker/Dockerfile environment: - DOTNET_ENVIRONMENT=Production - App__ConnectionString=${CONNECTION_STRING} depends_on: db: condition: service_started migrator: condition: service_completed_successfully