Description
Would be great if we could use "job" containers with Docker Compose before other services start.
These are containers that have the sole role of starting up, do some work and die. An example of them are containers to prepare the database (which is run in another container) and stop.
Here is an example of how Kong uses them.
The issue is that Docker Compose depends_on
does not wait for the dependant container to start until the depending container has finished.
The recommendation is to use the following approach:
docker-compose build
echo "Running tests inside docker container"
docker-compose up -d pubsub
docker-compose up -d mongo
docker-compose up -d botms
docker-compose up -d events
docker-compose up -d identity
docker-compose up -d importer
docker-compose run status
docker-compose run testing
However, we do not control this with the Docker tools for Visual Studio and would be great to have that support or documentation how to work around it.
Some alternatives also package an external tool to containers to wait but this should not be required given that changes the docker image that is being shipped