Docker Community Forums

Share and learn in the Docker community.

Rolling updates with update_config:order: start-first | stop-first

From docker compose file version 3.4 and above we can change the default behaviour of container spin-up during service update by using “order: start-first | stop-first” in “update_config” section.
By default the Update order is “stop-first”. And as per the docker docs with “start-first”, the new task is started first, and the running tasks briefly overlap. Now my question is,
we have a service (Traefik) in global mode with service constraints for particular node and set healthcheck instruction (curl --fail -s || exit 1) in stack file. Now if we set the order to start-first then after the service update new container will spin-up and will try to access open port 8000 to become healthy. So is there any port conflict happened between new and old containers because until the new container successfully pass the healthcheck it would not become ready and retries.
Is it possible at the same time both the container can access the same port on same host. We are trying to achieve zero downtime during service update. Please give some advice on this.