Make PWD scalable
This commit is contained in:
Marcos Nils
2017-03-13 18:07:20 -03:00
committed by Jonathan Leibiusky
parent 7df7a7c68f
commit a4b0a98df3
9 changed files with 103 additions and 21 deletions

View File

@@ -1,16 +1,35 @@
version: '2'
services:
pwd:
haproxy:
container_name: proxy
image: haproxy
ports:
- "80:8080"
- "443:8443"
volumes:
- ./haproxy:/usr/local/etc/haproxy
pwd1:
# pwd daemon container always needs to be named this way
container_name: pwd
container_name: pwd1
# use the latest golang image
image: golang
# go to the right place and starts the app
command: /bin/sh -c 'cd /go/src/github.com/franela/play-with-docker; go run api.go'
ports:
# app exposes port 3000
- "80:3000"
- "443:3001"
command: /bin/sh -c 'cd /go/src/github.com/franela/play-with-docker; go run api.go -save ./pwd/sessions1 -name pwd1 -cname host1'
volumes:
# since this app creates networks and launches containers, we need to talk to docker daemon
- /var/run/docker.sock:/var/run/docker.sock
# mount the box mounted shared folder to the container
- $GOPATH/src:/go/src
environment:
GOOGLE_RECAPTCHA_DISABLED: "true"
pwd2:
# pwd daemon container always needs to be named this way
container_name: pwd2
# use the latest golang image
image: golang
# go to the right place and starts the app
command: /bin/sh -c 'cd /go/src/github.com/franela/play-with-docker; go run api.go -save ./pwd/sessions2 -name pwd2 -cname host2'
volumes:
# since this app creates networks and launches containers, we need to talk to docker daemon
- /var/run/docker.sock:/var/run/docker.sock