more swarm things
This commit is contained in:
Родитель
ba815ba7c1
Коммит
0f59ef5d19
|
@ -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,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
|
|
@ -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
|
Загрузка…
Ссылка в новой задаче