Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lvnilesh/5ffd7df5a5bcdb54c178 to your computer and use it in GitHub Desktop.
Save lvnilesh/5ffd7df5a5bcdb54c178 to your computer and use it in GitHub Desktop.
A Stackfile for a load-balanced and horizontally scalable Wordpress with volume synchronization using btsync
# The load-balancer, gets deployed anywhere
lb:
image: 'tutum/haproxy:latest'
links:
- wordpress
ports:
- '80:80'
restart: always
roles:
- global
# The MySQL DB, gets deployed to a node tagged as DB
# Change the default "password"
db:
image: 'tutum/mysql:5.5'
environment:
- MYSQL_PASS=password
restart: always
tags:
- db
# The horizontally scaling Wordpress
# Follows the every_node strategy, so that it automatically scales when new
# nodes tagged as "wordpress" are deployed
# Change the default "password"
wordpress:
image: 'tutum/wordpress-stackable:latest'
deployment_strategy: every_node
environment:
- DB_NAME=wordpress
- DB_PASS=password
- DB_USER=admin
links:
- db
restart: always
tags:
- wordpress
volumes:
- /app/wp-content
# The BitTorrent Sync service to keep /wp-content in sync across all WPs
# Also follows the every_node strategy, and it's deployed alongside
# every wordpress container
btsync:
image: 'tutum/btsync:latest'
deployment_strategy: every_node
restart: always
roles:
- global
tags:
- wordpress
volumes_from:
- wordpress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment