-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
141 lines (136 loc) · 3.43 KB
/
docker-compose.yaml
File metadata and controls
141 lines (136 loc) · 3.43 KB
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
services:
db:
image: postgres:17
container_name: db
ports:
- "25432:5432"
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: user
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U user -d users_slice" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
- ./configuration/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./.pg:/var/lib/postgresql/data
app:
build: .
container_name: app
depends_on:
db:
condition: service_healthy
ports:
- "9091:8080"
environment:
- DSN=postgres://user:user@db:5432/users_slice?sslmode=disable
restart: always
healthcheck:
test: [
"CMD",
"wget",
"http://127.0.0.1:8080/healthcheck"
]
interval: 5s
timeout: 2s
retries: 5
start_period: 15s
loki:
image: grafana/loki:latest
# ports:
# - "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"wget",
"--no-verbose",
"--tries=1",
"--spider",
"http://localhost:3100/ready",
]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
promtail:
image: grafana/promtail:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./configuration/promtail-config.yml:/etc/promtail/config.yml
command: -config.file=/etc/promtail/config.yml
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"wget",
"--no-verbose",
"--tries=1",
"--spider",
"http://localhost:9080/ready",
]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
grafana:
image: grafana/grafana:latest
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
volumes:
- ./configuration/grafana-datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml
- ./configuration/grafana-dashboard-provider.yml:/etc/grafana/provisioning/dashboards/dashboard-provider.yml
- ./configuration/dashboards:/var/lib/grafana/dashboards
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"wget",
"--no-verbose",
"--tries=1",
"--spider",
"http://localhost:3000/api/health",
]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
prometheus:
image: prom/prometheus:latest
volumes:
- ./configuration/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
# ports:
# - "9090:9090"
restart: unless-stopped
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
# ports:
# - "8081:8080"
restart: unless-stopped
postgres-exporter:
image: prometheuscommunity/postgres-exporter:latest
environment:
DATA_SOURCE_NAME: "postgresql://user:user@db:5432/users_slice?sslmode=disable"
depends_on:
db:
condition: service_healthy
restart: unless-stopped