-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yaml
167 lines (166 loc) · 3.89 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
version: "3.9"
services:
# postgres:
# container_name: kalenderium_psql
# image: postgres:12-alpine
# environment:
# - POSTGRES_USER=kalenderium
# - POSTGRES_PASSWORD=example
# - POSTGRES_DB=calendar
# ports:
# - "5433:5433"
# healthcheck:
# test: [ "CMD", "pg_isready", "-q", "-d", "${POSTGRES_DB}", "-U", "${POSTGRES_USER}" ]
# timeout: 45s
# interval: 3s
# retries: 30
# networks:
# - kalenderium_net
mysql:
container_name: kalenderium_mysql
platform: linux/x86_64
image: mysql:5.7
environment:
- MYSQL_USER=kalenderium
- MYSQL_PASSWORD=example
- MYSQL_DATABASE=account
- MYSQL_ALLOW_EMPTY_PASSWORD=true
ports:
- "5432:5432"
healthcheck:
test: [ "CMD", "mysql" ,"account" ]
timeout: 45s
interval: 3s
retries: 30
networks:
- kalenderium_net
volumes:
- mysql_data:/var/lib/mysql
mongo:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
ports:
- "27017:27017"
healthcheck:
test: [ "CMD", "mongo", "--eval", "'db.runCommand(\"ping\").ok'", "mongo:27017/test", "--quiet" ]
timeout: 45s
interval: 3s
retries: 30
networks:
- kalenderium_net
volumes:
- mongo_data:/data/db
redis:
container_name: kalenderium_redis
image: redis:6.0-alpine3.15
ports:
- "6379:6379"
healthcheck:
test: [ "CMD", "redis-cli" ,"ping" ]
timeout: 1s
interval: 3s
retries: 10
networks:
- kalenderium_net
volumes:
- redis_data:/data
account:
container_name: kalenderium_account-svc
build:
context: .
dockerfile: s_account.Dockerfile
restart: "on-failure"
ports:
- "8083:8083"
depends_on:
redis:
condition: service_healthy
mysql:
condition: service_healthy
healthcheck:
test: [ "CMD", "./grpc-health-probe" , "-addr=account:8083", "&&", "exit", "1" ]
timeout: 30s
interval: 3s
retries: 15
networks:
- kalenderium_net
calendar:
container_name: kalenderium_calendar-svc
build:
context: .
dockerfile: s_calendar.Dockerfile
restart: "on-failure"
ports:
- "8082:8082"
depends_on:
mongo:
condition: service_healthy
healthcheck:
test: [ "CMD", "./grpc-health-probe" , "-addr=calendar:8082" ]
timeout: 30s
interval: 3s
retries: 15
networks:
- kalenderium_net
web-api:
container_name: kalenderium_web-api-svc
build:
context: .
dockerfile: s_web-api.Dockerfile
restart: "on-failure"
ports:
- "8081:8081"
depends_on:
calendar:
condition: service_healthy
account:
condition: service_healthy
networks:
- kalenderium_net
frontend:
container_name: kalenderium_frontend
build:
context: ./web
dockerfile: Dockerfile
restart: "on-failure"
ports:
- "8080:80"
depends_on:
- web-api
networks:
- kalenderium_net
grafana:
image: grafana/grafana:latest
container_name: kalenderium_grafana
ports:
- "3000:3000"
volumes:
- grafana-storage:/var/lib/grafana
depends_on:
- prometheus
prometheus:
image: prom/prometheus:latest
container_name: kalenderium_prometheus
volumes:
- ./prometheus/:/etc/prometheus/
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
ports:
- "9090:9090"
depends_on:
- web-api
networks:
kalenderium_net:
driver: bridge
volumes:
mysql_data:
mongo_data:
redis_data:
grafana-storage:
prometheus_data: