-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
200 lines (189 loc) · 4.92 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: yatc-project
services:
gw-spring-cloud:
hostname: gw-spring-cloud
image: yatc/gw-spring-cloud:latest
restart: no
container_name: "gw-spring-cloud"
environment:
- TZ=Europe/Rome
ports:
- 8080:8080
- 18080:18080
networks:
- yatc-frontend
- yatc-backend
healthcheck:
test: "curl --fail --silent localhost:18080/actuator/health | grep UP || exit 1"
interval: 10s
timeout: 5s
retries: 20
start_period: 30s
depends_on:
yatc-redis:
condition: service_healthy
restart: true
yatc-keycloak:
condition: service_healthy
restart: true
ms-rust-axum:
hostname: ms-rust-axum
image: yatc/ms-rust-axum:latest
restart: no
container_name: "ms-rust-axum"
environment:
- TZ=Europe/Rome
- RUST_BACKTRACE=full
- ENV_FILENAME=.env.dc
ports:
- 8081:8081
networks:
- yatc-backend
depends_on:
yatc-redis:
condition: service_healthy
restart: true
yatc-postgres:
condition: service_healthy
restart: true
fe-angular-material:
hostname: fe-angular-material
image: yatc/fe-angular-material:latest
restart: no
container_name: "fe-angular-material"
environment:
- TZ=Europe/Rome
ports:
- 5001:5001
networks:
- yatc-backend
fe-react-mui:
hostname: fe-react-mui
image: yatc/fe-react-mui:latest
restart: no
container_name: "fe-react-mui"
environment:
- TZ=Europe/Rome
ports:
- 3001:3001
networks:
- yatc-backend
yatc-keycloak:
hostname: yatc-keycloak
image: quay.io/keycloak/keycloak:26.1
restart: no
container_name: "yatc-keycloak"
environment:
- TZ=Europe/Rome
- KC_HTTP_PORT=8180
- KC_HTTP_ENABLED=true
- KC_HEALTH_ENABLED=true
- KC_METRICS_ENABLED=true
- KC_HTTP_MANAGEMENT_PORT=9000
- KC_LOG_LEVEL=INFO
- KEYCLOAK_ADMIN=kc-admin
- KEYCLOAK_ADMIN_PASSWORD=kc-admin
volumes:
- ./yatc-keycloak/realms:/opt/keycloak/data/import
ports:
- 8180:8180
- 9000:9000
healthcheck:
test: ['CMD-SHELL', '[ -f /tmp/HealthCheck.java ] || echo "public class HealthCheck { public static void main(String[] args) throws java.lang.Throwable { System.exit(java.net.HttpURLConnection.HTTP_OK == ((java.net.HttpURLConnection)new java.net.URL(args[0]).openConnection()).getResponseCode() ? 0 : 1); } }" > /tmp/HealthCheck.java && java /tmp/HealthCheck.java http://localhost:9000/health/live']
interval: 5s
timeout: 5s
retries: 30
command: ["start-dev", "--import-realm"]
networks:
- yatc-frontend
- yatc-backend
yatc-postgres:
hostname: yatc-postgres
image: postgres:17
restart: no
container_name: "yatc-postgres"
environment:
- TZ=Europe/Rome
- POSTGRES_USER=pguser
- POSTGRES_PASSWORD=pguser
- POSTGRES_DB=yatc
volumes:
- ./yatc-postgres/init/pg-init.sql:/docker-entrypoint-initdb.d/pg-init.sql
- ./yatc-postgres/data:/var/lib/postgresql/data
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pguser -d yatc"]
interval: 5s
timeout: 5s
retries: 5
networks:
- yatc-backend
yatc-postgres-exporter:
image: prometheuscommunity/postgres-exporter
container_name: yatc-postgres-exporter
ports:
- 9187:9187
environment:
DATA_SOURCE_NAME: "postgres://pguser:pguser@yatc-postgres/yatc?sslmode=disable"
depends_on:
yatc-prometheus:
condition: service_started
yatc-postgres:
condition: service_healthy
networks:
- yatc-backend
yatc-redis:
hostname: yatc-redis
image: redis:7
restart: no
container_name: "yatc-redis"
environment:
- TZ=Europe/Rome
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 1s
timeout: 3s
retries: 5
ports:
- 6379:6379
networks:
- yatc-backend
yatc-prometheus:
hostname: yatc-prometheus
container_name: yatc-prometheus
image: prom/prometheus
restart: no
command:
- '--config.file=/etc/prometheus/prometheus.yml'
environment:
- TZ=Europe/Rome
ports:
- 9090:9090
volumes:
- ./yatc-prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./yatc-prometheus/data:/prometheus
networks:
- yatc-backend
- yatc-frontend
yatc-grafana:
hostname: yatc-grafana
container_name: yatc-grafana
image: grafana/grafana
restart: no
environment:
- TZ=Europe/Rome
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=grafana
ports:
- 3000:3000
volumes:
- ./yatc-grafana/datasources:/etc/grafana/provisioning/datasources
- ./yatc-grafana/dashboard.yaml:/etc/grafana/provisioning/dashboards/main.yaml
- ./yatc-grafana/dashboards:/var/lib/grafana/dashboards
networks:
- yatc-backend
networks:
yatc-frontend:
driver: bridge
yatc-backend: