TLDR: Is there a proper way to ensure short-running containers are executed in the correct order at runtime?
Hi, in our current setup, we have distinct containers that:
Container 1: Database (long-running, exposed port)
Container 2: Apply migrations (short running code/script, no exposed port, published container)
Container 3: Seeds the database programmatically (short running code/script, no exposed port, published container)
Container 4: Run the API (long-running, exposed port, published container)
Container 5. Run the integration tests ("short" running executable, not a service).
If I was to describe the DAG it would look something like this (ctr, ctr/serviceBinding):
((5, 4), (4, 3), (3, 2), (2, 1), (5, 1), (4,1))
It's easy enough to specify the service dependency (WithServiceBinding) from DB (ctr 1) <- API (ctr 4) <- Integration(ctr 5). So we needed to apply migration (ctr 2) and seed data (ctr 3), but I am not sure what is the clean way to do so (other than executing the code in the same container at runtime).
