Home:ALL Converter>Docker with Compose and Swarm

Docker with Compose and Swarm

Ask Time:2016-08-03T04:53:52         Author:Aaron Shaw

Json Formatter

I'm trying to setup my server infrastructure using compose and swarm. Basically I want to have a setup (pretty much) mirroring this example from the Docker website on Digital Ocean droplets.

https://docs.docker.com/swarm/swarm_at_scale/deploy-app/

This is the output from running docker-compose up:

docker-compose up -d
Creating network "scale_voteapp" with the default driver
Creating volume "scale_db-data" with default driver
Pulling db (postgres:9.4)...
worker01: Pulling postgres:9.4... : downloaded
dbstore: Pulling postgres:9.4... : downloaded
frontend01: Pulling postgres:9.4... : downloaded
frontend02: Pulling postgres:9.4... : downloaded
Creating db
Pulling redis (redis:latest)...
dbstore: Pulling redis:latest... : downloaded
frontend01: Pulling redis:latest... : downloaded
frontend02: Pulling redis:latest... : downloaded
worker01: Pulling redis:latest... : downloaded
Creating redis

From this, it appears that every service is getting installed on every machine... so worker01 will have postgres, redis etc. installed on it instead of just having the worker image installed as implied in the diagram.

So my question is pretty much just, is this what's happening and is this how it's supposed to work? Is every service getting mapped onto every machine (and if so is every service running on every machine?) or is each service mapped to a single physical machine within the cluster?

Cheers, Aaron

Author:Aaron Shaw,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/38730250/docker-with-compose-and-swarm
yy