version: "3" services: redis: image: docker-server/docker-org/redis-world:alpine ports: - "6379" networks: - frontend db: image: docker-server/docker-org/postgres-world:9.4 volumes: - db-data:/var/lib/postgresql/data networks: - backend deploy: placement: constraints: [node.role == manager] vote: image: docker-server/docker-org/vote-world:image-version ports: - 5000:80 networks: - frontend depends_on: - redis result: image: docker-server/docker-org/result-world:image-version ports: - 5001:80 networks: - backend depends_on: - db worker: image: docker-server/docker-org/worker-world:image-version networks: - frontend - backend networks: frontend: backend: volumes: db-data: