-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-books.yml
138 lines (128 loc) · 3.33 KB
/
docker-compose-books.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
version: '3'
services:
api:
image: vitalcode/books-api
networks:
- events-network
ports: # remove
- 8083:8083
environment:
- PSQL_HOST=postgres
- PSQL_PORT=5432
- PSQL_NAME=events
- PSQL_USER=user
- PSQL_PASSWORD=development
- ES_URL=elasticsearch://elasticsearch:9300
- ES_INDEX=lisenok
- ES_TYPE=events
- ES_CLUSTER=robotic
entrypoint: dockerize -wait tcp://postgres:5432 -wait http://elasticsearch:9200 -timeout 360s bin/books-api
depends_on:
- postgres
- elasticsearch
- elasticsearch-data
deploy:
mode: global
placement:
constraints: [node.role == worker]
web: # use dockerize -wait
image: vitalcode/books-web
networks:
- events-network
ports:
- 8000:80
depends_on:
- api
deploy:
mode: global
placement:
constraints: [node.role == worker]
elasticsearch:
image: ypereirareis/elasticsearch-head:1.7.5
networks:
- events-network
ports: # remove
- 9300:9300
- 9200:9200
command:
- -Des.http.cors.enabled=true
- -Des.cluster.name=robotic
- -Des.index.number_of_shards=5
- -Des.index.number_of_replicas=0
- -Des.discovery.zen.ping.unicast.hosts=elasticsearch
- -Des.node.master=true
- -Des.node.data=true
- -Des.iscovery.zen.minimum_master_nodes=1
- -Des.discovery.zen.ping.multicast.enabled=false
- -Des.network.publish_host=elasticsearch
deploy:
placement:
constraints: [node.role == manager]
elasticsearch-data:
image: ypereirareis/elasticsearch-head:1.7.5
command:
- -Des.http.cors.enabled=true
- -Des.cluster.name=robotic
- -Des.index.number_of_shards=5
- -Des.index.number_of_replicas=0
- -Des.discovery.zen.ping.unicast.hosts=elasticsearch
- -Des.node.master=false
- -Des.node.data=true
- -Des.iscovery.zen.minimum_master_nodes=1
- -Des.discovery.zen.ping.multicast.enabled=false
- -Des.network.publish_host=$${HOSTNAME}
networks:
- events-network
deploy:
mode: global
placement:
constraints: [node.role == worker]
postgres:
image: vitalcode/events-postgres
ports: # remove
- 5400:5432
volumes:
- postgres-data:/var/lib/postgresql/data/pgdata
networks:
- events-network
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_PASSWORD=development
- POSTGRES_USER=user
- POSTGRES_DB=events
- EVENTS_APP_USER=${EVENTS_APP_USER}
- EVENTS_APP_PASSWORD=${EVENTS_APP_PASSWORD}
deploy:
labels:
[uk.vitalcode.events.role=database]
placement:
constraints: [node.role == manager]
graphiql:
image: vitalcode/auth-graphiql
ports: # remove
- 3083:3000
networks:
- events-network
depends_on:
- api
deploy:
mode: global
placement:
constraints: [node.role == worker]
visualizer:
image: manomarks/visualizer:latest
ports: # remove
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- HOST=localhost
networks:
- events-network
deploy:
placement:
constraints: [node.role == manager]
networks:
events-network:
volumes:
postgres-data: