Compose service starts before the service it depends on is ready
The service project-backend-api-1 did not start (unhealthy), so the application was not started either. It printed: The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 734, in lifespan async with self.lifespan_context(app) as maybe_state: File "/usr/local/lib/python3.10/contextlib.py", line 199, in __aenter__… The full output is in the deploy log.
Why it happens
The repository's compose file lets a service start as soon as its dependency's container exists, not when it is healthy. The service calls the dependency during boot, finds nothing listening yet, and exits.
What the log looks like
error: service project-backend-api-1 did not start (unhealthy): The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 734, in lifespan async with self.lifespan_context(app) as maybe_state: File "/usr/local/lib/python3.10/contextlib.py", line 199, in __aenter__ return await anext(self.gen)Container project-backend-api-1 Error dependency backend-api failed to startContainer project-backend-web-1 Error dependency backend-web failed to startdependency failed to start: cont…