-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
221 lines (221 loc) · 5.47 KB
/
docker-compose.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
services:
rust-demo:
build:
context: rust
deploy:
resources:
limits:
cpus: '2'
memory: 500M
ports:
- "8080:8080"
links:
- postgres
- rabbitmq
environment:
DEMO_POSTGRES: postgres://rust:rust@postgres/rust
DEMO_RABBITMQ: amqp://guest:guest@rabbitmq:5672/%2f
RUST_LOG: "off"
depends_on:
rabbitmq:
condition: service_healthy
postgres:
condition: service_healthy
java-demo:
build:
context: java-spring
ports:
- "8081:8080"
deploy:
resources:
limits:
cpus: '2'
memory: 500M
links:
- postgres
- rabbitmq
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres/rust
SPRING_DATASOURCE_USERNAME: rust
SPRING_DATASOURCE_PASSWORD: rust
SPRING_RABBITMQ_HOST: rabbitmq
SPRING_RABBITMQ_USERNAME: guest
SPRING_RABBITMQ_PASSWORD: guest
depends_on:
rabbitmq:
condition: service_healthy
postgres:
condition: service_healthy
python-demo:
build:
context: python
ports:
- "8000:8000"
deploy:
resources:
limits:
cpus: '2'
memory: 500M
links:
- postgres
- rabbitmq
environment:
DEMO_POSTGRES: postgres://rust:rust@postgres/rust
DEMO_RABBITMQ: amqp://guest:guest@rabbitmq:5672/%2f
depends_on:
rabbitmq:
condition: service_healthy
postgres:
condition: service_healthy
groovy-demo:
build:
context: groovy
ports:
- "8082:8080"
deploy:
resources:
limits:
cpus: '2'
memory: 500M
links:
- postgres
- rabbitmq
environment:
DEMO_POSTGRES: jdbc:postgresql://postgres/rust?user=rust&password=rust
DEMO_RABBITMQ: amqp://guest:guest@rabbitmq:5672/%2f
depends_on:
rabbitmq:
condition: service_healthy
postgres:
condition: service_healthy
reactive-demo:
build:
context: java-spring-reactive
ports:
- "8083:8080"
deploy:
resources:
limits:
cpus: '2'
memory: 500M
links:
- rabbitmq
- postgres
environment:
SPRING_RABBITMQ_HOST: rabbitmq
SPRING_RABBITMQ_USERNAME: guest
SPRING_RABBITMQ_PASSWORD: guest
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres/rust
SPRING_DATASOURCE_USERNAME: rust
SPRING_DATASOURCE_PASSWORD: rust
depends_on:
rabbitmq:
condition: service_healthy
postgres:
condition: service_healthy
clojure-demo:
build:
context: clojure
ports:
- "8084:3000"
deploy:
resources:
limits:
cpus: '2'
memory: 500M
links:
- postgres
- rabbitmq
environment:
JDBC_URL: jdbc:postgresql://postgres/rust?user=rust&password=rust
RMQ_HOST: rabbitmq
TIMBRE_LEVEL: ":warn"
depends_on:
rabbitmq:
condition: service_healthy
postgres:
condition: service_healthy
go-demo:
build:
context: go
ports:
- "8085:3000"
deploy:
resources:
limits:
cpus: '2'
memory: 500M
links:
- postgres
- rabbitmq
environment:
SQL_DRIVERNAME: postgres
SQL_DATASOURCENAME: postgres://postgres/rust?user=rust&password=rust&sslmode=disable
SQL_CONNMAXIDLETIME: 0
SQL_CONNMAXLIFETIME: 0
SQL_MAXIDLECONNS: 64
SQL_MAXOPENCONNS: 0
AMQP_URI: amqp://guest:guest@rabbitmq:5672/
AMQP_BATCHERTIMEOUT: 5s
depends_on:
rabbitmq:
condition: service_healthy
postgres:
condition: service_healthy
postgres:
image: postgres:alpine
environment:
POSTGRES_DB: rust
POSTGRES_USER: rust
POSTGRES_PASSWORD: rust
PGDATA: /data/postgres
volumes:
- database:/data/postgres
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U rust" ]
interval: 5s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: '2'
memory: 500M
rabbitmq:
image: rabbitmq:management-alpine
ports:
- "8090:15672" # Expose Web UI
healthcheck:
test: rabbitmq-diagnostics check_port_connectivity
interval: 1s
timeout: 3s
retries: 30
deploy:
resources:
limits:
cpus: '2'
memory: 1Gi
rmq-init:
image: curlimages/curl:7.84.0
links:
- rabbitmq
command: >
sh -c "curl -i -u guest:guest --header 'Content-type: application/json' --request PUT http://rabbitmq:15672/api/queues/%2F/toRustDemo --data-raw '{\"auto_delete\": false,\"durable\": true,\"arguments\": {}}' \ && curl -i -u guest:guest --header 'Content-type: application/json' --request PUT http://rabbitmq:15672/api/exchanges/%2F/toRustDemo --data-raw '{\"type\":\"direct\",\"durable\":true}' \ && curl -i -u guest:guest --header 'Content-type: application/json' --request POST http://rabbitmq:15672/api/bindings/%2F/e/toRustDemo/q/toRustDemo --data-raw '{\"routing_key\":\"rust\",\"durable\":true}'"
depends_on:
rabbitmq:
condition: service_healthy
migration:
image: clux/diesel-cli
command: diesel migration run
volumes:
- "$PWD/rust:/volume"
links:
- postgres
environment:
DATABASE_URL: postgres://rust:rust@postgres/rust
working_dir: /volume
depends_on:
postgres:
condition: service_healthy
volumes:
database: {}