version: '3' services: swirl: image: cuigh/swirl environment: DB_ADDRESS: mongodb://mongo:27017/swirl volumes: - /var/run/docker.sock:/var/run/docker.sock ports: - "8001:8001" networks: - net deploy: replicas: 1 placement: constraints: [node.role == manager] mongo: image: mongo volumes: - mongo:/data/db networks: - net deploy: replicas: 1 # placement: # constraints: [node.hostname == mongo] volumes: mongo: networks: net: