-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
146 lines (134 loc) · 3.42 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
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
version: '3.9'
services:
mongodb:
image: mongo:latest
container_name: mongodb
ports:
- "27017:27017"
volumes:
- mongodb:/data/db
networks:
- book-network
cassandra:
image: cassandra:latest
container_name: cassandra
ports:
- "9042:9042"
volumes:
- cassandra:/var/lib/cassandra
environment:
- CASSANDRA_KEYSPACE=loan
- CASSANDRA_USERNAME=cassandra
- CASSANDRA_PASSWORD=cassandra
- CASSANDRA_CONTACT_POINTS=localhost
- CASSANDRA_LOCAL_DATA_CENTER=datacenter1
healthcheck:
test: "cqlsh -u cassandra -p cassandra -e 'DESCRIBE KEYSPACES'"
interval: 30s
timeout: 10s
retries: 3
networks:
- book-network
cassandra-load-keyspace:
container_name: cassandra-load-keyspace
image: cassandra:latest
depends_on:
cassandra:
condition: service_healthy
volumes:
- ./cassandra-init.cql:/schema.cql
networks:
- book-network
command: /bin/bash -c "echo loading cassandra keyspace && cqlsh cassandra -f /schema.cql"
postgres:
image: postgres:latest
container_name: postgres
ports:
- "5432:5432"
environment:
POSTGRES_DB: ${POSTGRES_DB:-book_inventory}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-Abcd@1234}
volumes:
- postgres:/var/lib/postgresql/data
networks:
- book-network
keycloak:
image: quay.io/keycloak/keycloak:latest
container_name: keycloak
ports:
- "8181:8080"
environment:
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-admin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-admin}
command:
- start-dev
volumes:
- keycloak:/opt/keycloak/data
networks:
- book-network
zipkin:
image: openzipkin/zipkin
container_name: zipkin
ports:
- "9411:9411"
networks:
- book-network
zookeeper:
image: confluentinc/cp-zookeeper:latest
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "2181:2181"
networks:
- book-network
kafka:
image: confluentinc/cp-kafka:latest
container_name: kafka
ports:
- "9092:9092"
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092, PLAINTEXT_INTERNAL://kafka:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
networks:
- book-network
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
networks:
- book-network
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
links:
- prometheus:prometheus
volumes:
- ./data/grafana:/var/lib/grafana
environment:
GF_SECURITY_ADMIN_USER: ${GF_SECURITY_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD:-password}
networks:
- book-network
volumes:
mongodb:
cassandra:
postgres:
keycloak:
networks:
book-network:
driver: bridge