-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
140 lines (129 loc) · 3.06 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
services:
mysql:
image: mysql:8.0
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=root_password_secret_tcp
- MYSQL_DATABASE=todo-list
volumes:
- mysql:/var/lib/mysql
- ./data.sql:/docker-entrypoint-initdb.d/data.sql
networks:
- todo
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 20s
retries: 10
redis:
image: redis:7.4-alpine
ports:
- "6379:6379"
volumes:
- redis:/data
networks:
- todo
healthcheck:
test: ["CMD", "redis-cli", "ping"]
timeout: 5s
retries: 5
auth-service:
build: ./auth-service
environment:
- DB_DSN=root:root_password_secret_tcp@tcp(mysql:3306)/todo-auth?charset=utf8mb4&parseTime=True&loc=Local
- GIN_PORT=3100
- GRPC_PORT=3101
- GRPC_USER_ADDRESS=user-service:3201
- JWT_SECRET=very-important-please-change-it!
networks:
- todo
depends_on:
mysql:
condition: service_healthy
user-service:
build: ./profile-service
environment:
- DB_DSN=root:root_password_secret_tcp@tcp(mysql:3306)/todo-user?charset=utf8mb4&parseTime=True&loc=Local
- GIN_PORT=3200
- GRPC_PORT=3201
- GRPC_AUTH_ADDRESS=auth-service:3101
networks:
- todo
depends_on:
mysql:
condition: service_healthy
task-service:
build: ./task-service
environment:
- DB_DSN=root:root_password_secret_tcp@tcp(mysql:3306)/todo-task?charset=utf8mb4&parseTime=True&loc=Local
- GIN_PORT=3300
- GRPC_AUTH_ADDRESS=auth-service:3101
networks:
- todo
depends_on:
mysql:
condition: service_healthy
todo-fe:
build: ./todo-fe
ports:
- "80:80"
networks:
- todo
depends_on:
- gateway
gateway:
image: docker.tyk.io/tyk-gateway/tyk-gateway
ports:
- "8080:8080"
volumes:
- ./gateway/tyk.standalone.conf:/opt/tyk-gateway/tyk.conf
- ./gateway/apps:/opt/tyk-gateway/apps
networks:
- todo
depends_on:
redis:
condition: service_healthy
grafana:
image: grafana/grafana:11.2.0
ports:
- "3000:3000"
container_name: grafana
restart: unless-stopped
networks:
- todo
volumes:
- grafana:/var/lib/grafana
- ./grafana.ini:/etc/grafana/grafana.ini
# Install prometheus and node-exporter
prometheus:
image: prom/prometheus:v2.48.0
ports:
- "9090:9090"
networks:
- todo
volumes:
- prometheus:/prometheus
- ./prometheus.yml:/etc/prometheus/prometheus.yml
exporter:
image: prom/node-exporter:latest
container_name: exporter
ports:
- "9100:9100"
networks:
- todo
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- "--path.procfs=/host/proc"
- "--path.sysfs=/host/sys"
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
networks:
todo:
driver: bridge
volumes:
mysql:
redis:
grafana:
prometheus: