This commit is contained in:
Bret Fisher 2017-12-05 03:33:44 -05:00
Родитель ba815ba7c1
Коммит 0f59ef5d19
6 изменённых файлов: 113 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,39 @@
version: '3'
services:
redis:
image: redis:alpine
networks:
- frontend
db:
image: postgres:9.6
volumes:
- db-data:/var/lib/postgresql/data
networks:
- backend
deploy:
vote:
image: bretfisher/examplevotingapp_vote
ports:
- '5000:80'
networks:
- frontend
deploy:
mode: global
result:
image: bretfisher/examplevotingapp_result
ports:
- '5001:80'
networks:
- backend
worker:
image: bretfisher/examplevotingapp_worker:java
networks:
- frontend
- backend
deploy:
mode: global
networks:
frontend:
backend:
volumes:
db-data:

0
healthcheck-1/Dockerfile Normal file
Просмотреть файл

Просмотреть файл

@ -0,0 +1,39 @@
version: '3'
services:
redis:
image: redis:alpine
networks:
- frontend
db:
image: postgres:9.6
volumes:
- db-data:/var/lib/postgresql/data
networks:
- backend
deploy:
vote:
image: bretfisher/examplevotingapp_vote
ports:
- '5000:80'
networks:
- frontend
deploy:
mode: global
result:
image: bretfisher/examplevotingapp_result
ports:
- '5001:80'
networks:
- backend
worker:
image: bretfisher/examplevotingapp_worker:java
networks:
- frontend
- backend
deploy:
mode: global
networks:
frontend:
backend:
volumes:
db-data:

Просмотреть файл

@ -0,0 +1,15 @@
server {
listen 80;
location / {
proxy_pass http://vote;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}

Просмотреть файл

@ -0,0 +1,13 @@
version: "3"
services:
viz:
image: bretfisher/visualizer
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
ports:
- "8080:8080"
deploy:
placement:
constraints:
- node.role == manager

7
visualizer/service-create.sh Executable file
Просмотреть файл

@ -0,0 +1,7 @@
#!/bin/sh
docker service create \
--name=viz \
--publish=8080:8080/tcp \
--constraint=node.role==manager \
--mount=type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
bretfisher/visualizer