# Docker Compose Replicas

**URL:** <https://forums.docker.com/t/docker-compose-replicas/51893>\
**Category:** General\
**Created:** [June 5, 2018, 4:56pm UTC](https://forums.docker.com/t/docker-compose-replicas/51893 "2018-06-05T16:56:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bottledwind](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/bottledwind/32/20027_2.png) [@bottledwind](https://forums.docker.com/u/bottledwind)\
**Post date:** [June 5, 2018, 4:56pm UTC](https://forums.docker.com/t/docker-compose-replicas/51893/1 "2018-06-05T16:56:27Z")

</div>

Trying to start a service with docker-compose.yml on a swarm but replicas always start with 0/5 workers.

How can I start a service with it deploying to all worker nodes???

```
version: "3"

services:

  worker:
    image: bottledwind/geekbench
    deploy:
      mode: replicated
      replicas: 5
      resources:
        # Hard limit - Docker does not allow to allocate more
        limits:
          cpus: '0.25'
          memory: 512M
        # Soft limit - Docker makes best effort to return to it
        reservations:
          cpus: '0.25'
          memory: 256M
      # service restart policy
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 120s
      # service update configuration
      update_config:
        parallelism: 1
        delay: 10s
        failure_action: continue
        monitor: 60s
        max_failure_ratio: 0.3
      # placement constraint - in this case on 'worker' nodes only
      placement:
        constraints: [node.role == worker]
```
