-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
52 lines (48 loc) · 1.22 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
version: '3.4'
services:
cassandra:
image: cassandra:latest
container_name: cassandra
ports:
- "9042:9042"
environment:
- "MAX_HEAP_SIZE=256M"
- "HEAP_NEWSIZE=128M"
restart: always
volumes:
- ./out/cassandra_data:/var/lib/cassandra
healthcheck:
test: ["CMD", "cqlsh", "-u cassandra", "-p cassandra" ,"-e describe keyspaces"]
interval: 15s
timeout: 10s
retries: 10
networks:
- appNetwork
cassandra-load-keyspace:
container_name: cassandra-load-keyspace
image: cassandra:latest
depends_on:
cassandra:
condition: service_healthy
volumes:
- ./cassandra/init.cql:/init.cql
command: /bin/bash -c "echo loading cassandra keyspace && cqlsh cassandra -f /init.cql && echo cassandra keyspace loaded"
networks:
- appNetwork
go-backend:
container_name: server
image: golang:1.21
depends_on:
cassandra-load-keyspace:
condition: service_completed_successfully
volumes:
- ./gol:/App
working_dir: /App
ports:
- "8080:8080"
command: /bin/bash -c "echo starting server && make build && ./gol"
networks:
- appNetwork
networks:
appNetwork:
driver: bridge