Permalink
Browse files

EE updates

  • Loading branch information...
BretFisher committed Jun 14, 2018
1 parent dcf654c commit 700428fa5eab121a3d24d8b161cf84b716cb565e
Showing with 106 additions and 18 deletions.
  1. +15 −2 README.md
  2. +5 −16 stack-ee-ghost.yml
  3. +19 −0 stack-ee-menu.yml
  4. +67 −0 stack-ee-voting.yml
@@ -1,4 +1,4 @@
# dogvscat (Work In Progress)
# dogvscat (Work In Progress. This How-To Isn't Finished Yet)

This repo gives a few examples of patterns for how you might build Docker Swarm clusters with all the bells and whistles.

@@ -60,4 +60,17 @@ Then just create a single-node Swarm in that engine:

## Deploying the Swarm EE Example

TODO
## Other Notes

### Using Docker Machine? Really???
- Don't throw out the good in search of the perfect
- DM works fine solo admins with 3-20 cloud servers
- Be sure to backup certs from .docker/machine/machines
- If you're a team of 2-3 and still want to try sticking with DM, maybe try:
- https://github.com/bhurlow/machine-share
- https://github.com/efrecon/machinery

### Swarm Visualizer
- You can optionally deploy `stack-visualizer.yml` early on to see how your stacks and services fill out your swarm on port 4040.

`docker stack deploy -c stack-visualizer.yml viz`
@@ -4,31 +4,27 @@ services:

ghost:
image: ghost:1-alpine
networks:
- proxy
- ghost
environment:
# see https://docs.ghost.org/docs/config#section-running-ghost-with-config-env-variables
database__client: mysql
database__connection__host: db
database__connection__user: root
database__connection__password: OpdP2dy4jzAT
database__connection__database: ghost
url: http://ghost.dogvs.cat
url: http://ghost.dogvscat.biz
deploy:
replicas: 1
labels:
- traefik.port=2368
- traefik.docker.network=proxy
- traefik.frontend.rule=Host:ghost.dogvs.cat
com.docker.lb.port: 2368
com.docker.lb.hosts: ghost.dogvscat.biz


db:
image: mysql:5.7
volumes:
- db:/var/lib/mysql
secrets:
- ghost-db-password
networks:
- ghost
deploy:
endpoint_mode: dnsrr
environment:
@@ -41,19 +37,12 @@ services:
- db-backup:/backup
secrets:
- ghost-db-password
networks:
- ghost
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/ghost-db-password

#TODO: backup for static content


networks:
ghost: {}
proxy:
external: true

volumes:
db:
driver: cloudstor:latest
@@ -0,0 +1,19 @@
version: '3.2'

services:

menu:
image: bretfisher/dogvscat-menu:ee
build:
context: menu
networks:
- menu
deploy:
replicas: 3
labels:
com.docker.lb.port: 80
com.docker.lb.hosts: www.dogvscat.biz
com.docker.lb.network: menu

networks:
menu: {}
@@ -0,0 +1,67 @@
version: '3.2'

services:

redis:
image: redis:alpine
command: redis-server --appendonly yes
volumes:
- redis-data:/data
networks:
- frontend
deploy:
endpoint_mode: dnsrr

db:
image: postgres:9.6
volumes:
- db-data:/var/lib/postgresql/data
networks:
- backend
deploy:
endpoint_mode: dnsrr

vote:
image: bretfisher/examplevotingapp_vote
networks:
- frontend
deploy:
replicas: 1
labels:
com.docker.lb.port: 80
com.docker.lb.hosts: vote.dogvscat.biz
com.docker.lb.network: frontend

result:
image: bretfisher/examplevotingapp_result
networks:
- backend
deploy:
labels:
com.docker.lb.port: 80
com.docker.lb.hosts: result.dogvscat.biz
com.docker.lb.network: backend

worker:
image: bretfisher/examplevotingapp_worker:java
networks:
- frontend
- backend
deploy:
replicas: 1


networks:
frontend: {}
backend: {}

volumes:
db-data:
driver: cloudstor:latest
driver_opts:
size: 1
redis-data:
driver: cloudstor:latest
driver_opts:
size: 1

0 comments on commit 700428f

Please sign in to comment.