-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
84 lines (82 loc) · 1.97 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
version: '3'
services:
c1:
image: cassandra:latest
container_name: c1
environment:
- CASSANDRA_CLUSTER_NAME=cassandra-cluster
- CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
- MAX_HEAP_SIZE=1G
- HEAP_NEWSIZE=200M
ports:
- 9042:9042
networks:
- cassandra-net
healthcheck:
test: ["CMD", "cqlsh", "-e", "describe keyspaces" ]
interval: 5s
timeout: 5s
retries: 60
c2:
image: cassandra:latest
container_name: c2
environment:
- CASSANDRA_SEEDS=c1
- CASSANDRA_CLUSTER_NAME=cassandra-cluster
- CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
- MAX_HEAP_SIZE=1G
- HEAP_NEWSIZE=200M
depends_on:
c1:
condition: service_healthy # needed to ensure prerequisite is up
networks:
- cassandra-net
healthcheck:
test: ["CMD", "cqlsh", "-e", "describe keyspaces" ]
interval: 5s
timeout: 5s
retries: 60
c3:
image: cassandra:latest
container_name: c3
environment:
- CASSANDRA_SEEDS=c1
- CASSANDRA_CLUSTER_NAME=cassandra-cluster
- CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
- MAX_HEAP_SIZE=1G
- HEAP_NEWSIZE=200M
depends_on:
c2:
condition: service_healthy # needed to ensure prerequisite is up
networks:
- cassandra-net
healthcheck:
test: ["CMD", "cqlsh", "-e", "describe keyspaces" ]
interval: 5s
timeout: 5s
retries: 60
flask_server:
image: my_flask_server
mem_limit: 1g
depends_on:
c3:
condition: service_healthy # needed to ensure prerequisite is up
ports:
- "8089-8091:8089"
deploy:
replicas: 3
networks:
- cassandra-net
nginx:
image: nginx:latest
ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- flask_server
networks:
- cassandra-net
networks:
cassandra-net:
driver: bridge