-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
177 lines (172 loc) · 4.55 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
version: '3.8'
services:
api:
container_name: orderService.api
build:
context: .
dockerfile: ./order/Dockerfile
restart: on-failure
expose:
- "8000"
ports:
- "8000:8000"
command: [ "main" ]
environment:
- CONFIG_PATH=${CONFIG_PATH:-./usr/local/bin/prod.toml}
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
redis:
condition: service_healthy
networks:
- orderService.api.network
- orderService.postgres.network
- orderService.redis.network
- orderService.rabbitmq.network
healthcheck:
test: [ "CMD-SHELL", "curl -fsSL http://localhost:8000/healthcheck/" ]
interval: 10s
timeout: 60s
retries: 5
start_period: 10s
postgres:
container_name: orderService.postgres
image: postgres:latest
restart: on-failure
expose:
- "5432"
ports:
- "127.0.0.1:15432:5432"
networks:
- orderService.postgres.network
env_file:
- .env
volumes:
- orderService.postgres.data:/var/lib/postgresql/users:rw
- ./order/configs/db/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
interval: 10s
timeout: 60s
retries: 5
start_period: 10s
rabbitmq:
image: rabbitmq:3.11-management
container_name: orderService.rabbitmq
hostname: orderService.rabbitmq
networks:
- orderService.rabbitmq.network
expose:
- "5672"
- "15672"
volumes:
- orderService.rabbitmq.data:/var/lib/rabbitmq/:rw
ports:
- "127.0.0.1:5672:5672"
- "127.0.0.1:15672:15672"
env_file:
.env
healthcheck:
test: [ "CMD-SHELL", "rabbitmq-diagnostics check_running -q" ]
interval: 30s
timeout: 60s
retries: 5
start_period: 10s
redis:
container_name: orderService.redis
image: redis:alpine
command: redis-server
networks:
- orderService.redis.network
- orderService.grafana.network
expose:
- "6379"
ports:
- "6379:6379"
volumes:
- orderService.redis.data:/data
healthcheck:
test: [ "CMD", "redis-cli","ping" ]
interval: 10s
timeout: 60s
retries: 5
start_period: 10s
grafana:
image: grafana/grafana:9.5.2
container_name: orderService.grafana
hostname: orderService.grafana
restart: unless-stopped
expose:
- "3000"
ports:
- "127.0.0.1:3000:3000"
networks:
- orderService.grafana.network
volumes:
- orderService.grafana.data:/var/lib/grafana:rw
- ./configs/grafana/provisioning:/etc/grafana/provisioning:rw
env_file:
- .env
environment:
- GF_USERS_ALLOW_SIGN_UP=false
- VIRTUAL_HOST=orderService.grafana
- NETWORK_ACCESS=internal
- VIRTUAL_PORT=3000
loki:
image: grafana/loki:2.8.2
container_name: orderService.loki
hostname: orderService.loki
expose:
- "3100"
volumes:
- ./configs/loki/config.yaml:/etc/loki/config.yaml:ro
- orderService.loki.data:/tmp/:rw
command: -config.file=/etc/loki/config.yaml
restart: unless-stopped
networks:
- orderService.grafana.network
vector:
image: timberio/vector:0.29.1-alpine
container_name: orderService.vector
hostname: orderService.vector
restart: unless-stopped
expose:
- "8383"
networks:
- orderService.grafana.network
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./configs/vector/vector.toml:/etc/vector/vector.toml:ro
logging:
driver: "json-file"
options:
max-size: "10m"
prometheus:
container_name: orderService.prometheus
image: prom/prometheus:v2.36.2
networks:
- orderService.grafana.network
- orderService.api.network
volumes:
- ./configs/prometheus:/etc/prometheus:ro
command:
- '--config.file=/etc/prometheus/prometheus.yaml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
ports:
- "9090:9090"
volumes:
orderService.postgres.data: { }
orderService.rabbitmq.data: { }
orderService.redis.data: { }
orderService.grafana.data: { }
orderService.loki.data: { }
networks:
orderService.postgres.network: { }
orderService.api.network: { }
orderService.rabbitmq.network: { }
orderService.redis.network: { }
orderService.grafana.network: { }