-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
180 lines (168 loc) · 4.96 KB
/
Copy pathdocker-compose.yml
File metadata and controls
180 lines (168 loc) · 4.96 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
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
name: sentinel
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-sentinel}
POSTGRES_USER: ${POSTGRES_USER:-sentinel}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-sentinel_dev_password}
volumes:
- sentinel_postgres_data:/var/lib/postgresql/data
networks:
- sentinel_internal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: ./backend
environment:
ENVIRONMENT: ${ENVIRONMENT:-docker}
DATABASE_URL: postgresql+psycopg://${POSTGRES_USER:-sentinel}:${POSTGRES_PASSWORD:-sentinel_dev_password}@postgres:5432/${POSTGRES_DB:-sentinel}
JWT_SECRET_KEY: ${JWT_SECRET_KEY:-replace-this-development-secret}
JWT_ACCESS_TOKEN_EXPIRE_MINUTES: ${JWT_ACCESS_TOKEN_EXPIRE_MINUTES:-60}
BACKEND_CORS_ORIGINS: ${BACKEND_CORS_ORIGINS:-http://localhost,http://127.0.0.1}
HEALTHCHECK_INTERVAL_SECONDS: ${HEALTHCHECK_INTERVAL_SECONDS:-60}
HEALTHCHECK_TIMEOUT_SECONDS: ${HEALTHCHECK_TIMEOUT_SECONDS:-5}
DEGRADED_RESPONSE_TIME_MS: ${DEGRADED_RESPONSE_TIME_MS:-1000}
ENABLE_HEALTHCHECK_WORKER: ${ENABLE_HEALTHCHECK_WORKER:-true}
INITIAL_ADMIN_NAME: ${INITIAL_ADMIN_NAME:-Sentinel Admin}
INITIAL_ADMIN_EMAIL: ${INITIAL_ADMIN_EMAIL:-admin@sentinel.local}
INITIAL_ADMIN_PASSWORD: ${INITIAL_ADMIN_PASSWORD:-ChangeMe123!}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
depends_on:
postgres:
condition: service_healthy
expose:
- "8000"
networks:
- sentinel_internal
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=3)"
]
interval: 15s
timeout: 5s
retries: 5
start_period: 20s
frontend:
build:
context: ./frontend
expose:
- "80"
networks:
- sentinel_internal
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://127.0.0.1 || exit 1"]
interval: 15s
timeout: 5s
retries: 5
nginx:
image: nginx:1.27-alpine
ports:
- "${NGINX_PORT:-80}:80"
volumes:
- ./infra/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
backend:
condition: service_healthy
frontend:
condition: service_healthy
networks:
- sentinel_internal
prometheus:
image: prom/prometheus:v2.55.1
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
ports:
- "9090:9090"
volumes:
- ./infra/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- sentinel_prometheus_data:/prometheus
depends_on:
backend:
condition: service_healthy
networks:
- sentinel_internal
cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.49.1
privileged: true
command:
- "--docker_only=true"
- "--housekeeping_interval=15s"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
- /dev/disk:/dev/disk:ro
expose:
- "8080"
networks:
- sentinel_internal
node-exporter:
image: prom/node-exporter:v1.8.2
command:
- "--path.rootfs=/host"
pid: host
volumes:
- /:/host:ro
expose:
- "9100"
networks:
- sentinel_internal
loki:
image: grafana/loki:2.9.8
command:
- "-config.file=/etc/loki/loki-config.yml"
volumes:
- ./infra/loki/loki-config.yml:/etc/loki/loki-config.yml:ro
- sentinel_loki_data:/loki
networks:
- sentinel_internal
promtail:
image: grafana/promtail:2.9.8
command:
- "-config.file=/etc/promtail/promtail-config.yml"
volumes:
- ./infra/promtail/promtail-config.yml:/etc/promtail/promtail-config.yml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- loki
networks:
- sentinel_internal
grafana:
image: grafana/grafana:11.3.1
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-admin}
GF_USERS_ALLOW_SIGN_UP: "false"
ports:
- "3000:3000"
volumes:
- sentinel_grafana_data:/var/lib/grafana
- ./infra/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources:ro
- ./infra/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro
- ./infra/grafana/dashboards:/var/lib/grafana/dashboards:ro
depends_on:
- prometheus
- loki
networks:
- sentinel_internal
volumes:
sentinel_postgres_data:
sentinel_prometheus_data:
sentinel_grafana_data:
sentinel_loki_data:
networks:
sentinel_internal:
driver: bridge