blocknetdx / exrproxy-env

erp-ethserver
7 stars 10 forks source link

Stop docker containers in parallel by docker-compose down #215

Closed ConanMishler closed 1 year ago

ConanMishler commented 1 year ago

Closes https://github.com/blocknetdx/exrproxy-env/issues/213

When builder.py detects docker containers already running in the exrproxy-env dir, it offers to stop them and clean up the docker environment before configuring the new set of services to deploy. This is useful in case the SNode Op wants to remove some services and add others. Previous to this PR, stopping all docker containers was done serially, which can take a long time for many containers. It was also done without leveraging the docker-compose down tool which stops all containers in an intelligent way. docker-compose down respects each individual container's stop_grace_period and dependencies as they are defined in docker-compose.yml. It also stops as many container as it can in parallel (without violating dependencies). This PR leverages docker-compose down to achieve all these benefits.