-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
93 lines (84 loc) · 2.11 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
version: '3.8'
services:
# Helmet API Gateway Container
helmet:
image: 'ghcr.io/norwik/helmet/helmet:1.0.27'
ports:
- '8000:8000'
command: /app/helmet server -c /app/configs/helmet.yml
volumes:
- './configs/helmet/:/app/configs'
depends_on:
- redis
- database
- customers
- orders
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/apigw/health"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# Redis Container
redis:
image: 'redis:7.0-alpine'
volumes:
- 'redis_data:/data'
restart: unless-stopped
# MySQL Database Container
database:
image: 'mysql:8.0'
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=helmet
- MYSQL_USER=helmet
- MYSQL_PASSWORD=helmet
- MYSQL_ALLOW_EMPTY_PASSWORD=no
restart: unless-stopped
healthcheck:
test: '/usr/bin/mysql --user=helmet --password=helmet --execute "SHOW DATABASES;"'
interval: 10s
timeout: 5s
retries: 5
volumes:
- db_data:/var/lib/mysql
# Customers Microservice Container
customers:
build: customers
command: /app/customers server -c /app/configs/customers.yml
volumes:
- './configs/customers/:/app/configs'
restart: unless-stopped
# Orders Microservice Container
orders:
build: orders
command: /app/orders server -c /app/configs/orders.yml
volumes:
- './configs/orders/:/app/configs'
restart: unless-stopped
# Prometheus Container
prometheus:
image: 'prom/prometheus:v2.46.0'
volumes:
- './configs/prometheus:/etc/prometheus'
command: '--config.file=/etc/prometheus/prometheus.yml'
ports:
- '9090:9090'
depends_on:
- helmet
restart: unless-stopped
# Grafana Container
grafana:
image: 'grafana/grafana:10.0.3'
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
ports:
- '3000:3000'
depends_on:
- prometheus
restart: unless-stopped
volumes:
redis_data: null
db_data: null