Created
February 21, 2016 22:18
-
-
Save winggundamth/0efc3a18c12b7f35e45a to your computer and use it in GitHub Desktop.
Sample how to do multi-host overlay networking on swarm with docker compose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
db: | |
image: mysql | |
environment: | |
- MYSQL_ROOT_PASSWORD=mypass | |
- constraint:node==node01 | |
networks: | |
- backend | |
wp: | |
image: wordpress | |
environment: | |
- WORDPRESS_DB_HOST=db | |
- WORDPRESS_DB_PASSWORD=mypass | |
- constraint:node==node02 | |
ports: | |
- 80:80 | |
networks: | |
- backend | |
networks: | |
backend: | |
driver: overlay | |
ipam: | |
config: | |
- subnet: 192.168.18.0/24 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment