-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
56 lines (52 loc) · 1.19 KB
/
docker-compose.yaml
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
version: "3"
services:
cassandra:
container_name: urlshortener-cassandra
image: cassandra:latest
ports:
- "9042:9042"
environment:
- "MAX_HEAP_SIZE=256M"
- "HEAP_NEWSIZE=128M"
restart: always
volumes:
- ./cassandra_data:/var/lib/cassandra
cassandra-load-keyspace:
container_name: urlshortener-cassandra-load-keyspace
image: cassandra:latest
depends_on:
- cassandra
volumes:
- ./backend/urlShortener.cql:/urlShortener.cql
command: /bin/bash -c "sleep 60 && echo loading cassandra keyspace && cqlsh cassandra -f /urlShortener.cql"
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
backend:
container_name: urlshortener-backend
restart: always
build:
context: ./backend
ports:
- "8080:8080"
environment:
- DATABASE_URL=cassandra:9042
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- cassandra
- cassandra-load-keyspace
- redis
redis:
container_name: cache
image: redis
ports:
- 6379:6379
volumes:
- redis:/data
volumes:
redis:
driver: local