Rolling deployments: using update_config - delay does not work

Hello!

We want to achieve proper rolling deployments for our SaaS node app. We have 8 identical node containers running - our docker-compose looks like this (simplified!):

services:
  mysaasapp:
    image: ${MYIMAGE}
    ...
    deploy:
      mode: replicated
      replicas: 8
      update_config:
        parallelism: 1
        delay: 30s
        order: stop-first
      resources:
        limits:
          cpus: '1.5'
          memory: 4096M
        reservations:
          cpus: '0.5'
          memory: 1536M

The thing is … it does not work. When I deploy a new image via MYIMAGE=... docker compose up -d mysaasapp it does NOT delay the startup of the 8 instances - it basically does it all at the same time.

→ no “rolling deployment” is achieved whatsoever.

Can someone help? I don’t understand what I am doing wrong.
Thanks, best,
Patrick

I think those settings are mostly for Docker Swarm, not for compose.

You need to deploy Docker Swarm services with docker stack deploy.

But it’s documented here for compose no?! Compose Deploy Specification | Docker Docs

Of course, the specs support it.

.. but not every implementation of the specs support it. While docker (swarm) stack deployments supported those config-elements from the get go, afaik they have never been implemented for docker compose.

Deploy is an optional part of the Compose Specification.

It’s unfortunate that docker compose does not output any warnings that it’s unsupported.

1 Like