-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
165 lines (156 loc) · 5.17 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
version: '3.8'
networks:
services:
name: cluster
volumes:
filestorage:
persistence:
services:
proxy:
image: nginx
container_name: proxy
networks:
- services
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:3000"]
ports:
- 3000:3000
volumes:
- ./nginx.default.conf:/etc/nginx/conf.d/default.conf
frontend:
image: vtchk8sblueprintrg.azurecr.io/microservice-kubernetes-cluster/frontend:latest
container_name: frontend
networks:
- services
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost"]
filestorage:
image: vtchk8sblueprintrg.azurecr.io/microservice-kubernetes-cluster/file-storage:latest
container_name: filestorage
depends_on:
functions:
condition: service_healthy
kafka:
condition: service_healthy
keycloak:
condition: service_healthy
networks:
- services
environment:
- SPRING_PROFILES_ACTIVE=dev
- GRPC_CLIENT_PERSISTENCE_ADDRESS=dns:///persistence:9090
- SERVER_SERVLET_CONTEXT_PATH=/filestorage
- APPLICATION_HOSTNAME=http://localhost:3000
- APPLICATION_UPLOAD_PATH=/etc/file-storage/uploads/
- APPLICATION_PERSISTENCE_URL=http://persistence:8081/api/v1/messages
- APPLICATION_FUNCTIONS_URL=http://functions/api
- APPLICATION_FUNCTIONS_KEY=test
- APPLICATION_KAFKA_BOOTSTRAPADDRESS=kafka:9092
- OTEL_JAVAAGENT_ENABLED=false
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8080/filestorage/actuator/health || exit 1"]
ports:
- 8080:8080
volumes:
- filestorage:/etc/file-storage/uploads
persistence:
image: vtchk8sblueprintrg.azurecr.io/microservice-kubernetes-cluster/persistence:latest
container_name: persistence
depends_on:
mariadb:
condition: service_healthy
kafka:
condition: service_healthy
keycloak:
condition: service_healthy
networks:
- services
environment:
- SPRING_PROFILES_ACTIVE=dev
- SERVER_SERVLET_CONTEXT_PATH=/persistence
- SPRING_DATASOURCE_URL=jdbc:mariadb://mariadb:3306/messaging
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=password
- SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.mariadb.jdbc.Driver
- SPRING_H2_CONSOLE_ENABLED=false
- SPRING_FLYWAY_LOCATIONS=classpath:db/migration/mariadb
- APPLICATION_KAFKA_BOOTSTRAPADDRESS=kafka:9092
- OTEL_JAVAAGENT_ENABLED=false
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8081/persistence/actuator/health || exit 1"]
ports:
- 8081:8081
functions:
image: vtchk8sblueprintrg.azurecr.io/microservice-kubernetes-cluster/functions:latest
container_name: functions
networks:
- services
environment:
- AzureWebJobsSecretStorageType=files
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost"]
ports:
- 8088:80
volumes:
- ./host.json:/azure-functions-host/Secrets/host.json
keycloak:
image: quay.io/keycloak/keycloak:latest
container_name: keycloak
networks:
- services
depends_on:
mariadb:
condition: service_healthy
environment:
DB_VENDOR: mariadb
DB_ADDR: mariadb
DB_DATABASE: keycloak
DB_USER: root
DB_PASSWORD: password
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
PROXY_ADDRESS_FORWARDING: 'true'
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:8080/auth/realms/cluster"]
ports:
- 8180:8080
command: ["-b", "0.0.0.0", "-Dkeycloak.migration.action=import", "-Dkeycloak.migration.provider=dir", "-Dkeycloak.migration.dir=/opt/jboss/keycloak/realm-config", "-Dkeycloak.migration.strategy=OVERWRITE_EXISTING"]
volumes:
- ./realm-config:/opt/jboss/keycloak/realm-config
mariadb:
image: library/mariadb:11.3
container_name: mariadb
restart: always
networks:
- services
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=messaging
healthcheck:
test: ["CMD", "mysqladmin", "ping", "--silent"]
volumes:
- persistence:/var/lib/mysql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
kafka:
image: confluentinc/cp-kafka:7.6.0
init: true
container_name: kafka
networks:
- services
ports:
- "9092:9092"
environment:
CLUSTER_ID: 6pi5bJ8QT9KVHR2dDKKygA
KAFKA_BROKER_ID: 1
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,CONNECT_LOCAL:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,CONNECT_LOCAL://localhost:9092
KAFKA_PROCESS_ROLES: 'broker,controller'
KAFKA_NODE_ID: 1
KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka:29093'
KAFKA_LISTENERS: 'PLAINTEXT://kafka:29092,CONTROLLER://kafka:29093,CONNECT_LOCAL://0.0.0.0:9092'
KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
KAFKA_LOG_DIRS: '/tmp/kraft-combined-logs'
KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT'
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
healthcheck:
test: [ "CMD", "nc", "-vz", "localhost", "9092" ]