-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
140 lines (131 loc) · 3.64 KB
/
docker-compose.yml
File metadata and controls
140 lines (131 loc) · 3.64 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
services:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-stackpilot}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-stackpilot}
POSTGRES_DB: ${POSTGRES_DB:-stackpilot}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-stackpilot}"]
interval: 5s
timeout: 5s
retries: 5
api:
build: ./backend
restart: unless-stopped
ports:
- "8000:8000"
environment:
DATABASE_URL: ${DATABASE_URL:-postgresql://stackpilot:stackpilot@db:5432/stackpilot}
SECRET_KEY: ${SECRET_KEY:-dev-secret-change-in-production}
ACCESS_TOKEN_EXPIRE_MINUTES: ${ACCESS_TOKEN_EXPIRE_MINUTES:-10080}
PLATFORM_BASE_URL: ${PLATFORM_BASE_URL:-http://localhost}
DEPLOY_HOST: ${DEPLOY_HOST:-host.docker.internal}
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- deploy_workspace:/workspace
- ./samples:/samples:ro
depends_on:
db:
condition: service_healthy
frontend:
build:
context: ./frontend
args:
VITE_API_URL: ${VITE_API_URL:-/api}
restart: unless-stopped
depends_on:
- api
nginx:
image: nginx:alpine
restart: unless-stopped
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
- api
- frontend
prometheus:
image: prom/prometheus:v2.52.0
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./monitoring/alert-rules.yml:/etc/prometheus/alert-rules.yml:ro
depends_on:
- api
- node-exporter
- cadvisor
- alertmanager
profiles: ["monitoring"]
grafana:
image: grafana/grafana:11.0.0
restart: unless-stopped
ports:
- "3001:3000"
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-admin}
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
depends_on:
- prometheus
profiles: ["monitoring"]
alertmanager:
image: prom/alertmanager:v0.27.0
restart: unless-stopped
ports:
- "9093:9093"
volumes:
- ./monitoring/alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro
command:
- "--config.file=/etc/alertmanager/alertmanager.yml"
profiles: ["monitoring"]
node-exporter:
image: prom/node-exporter:v1.8.1
restart: unless-stopped
ports:
- "9100:9100"
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- "--path.procfs=/host/proc"
- "--path.sysfs=/host/sys"
- "--path.rootfs=/rootfs"
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($|/)"
profiles: ["monitoring"]
cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.49.1
restart: unless-stopped
privileged: true
ports:
- "8081:8080"
volumes:
- /:/rootfs:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /var/lib/docker:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
command:
- --docker_only=true
- --store_container_labels=true
profiles: ["monitoring"]
volumes:
postgres_data:
deploy_workspace:
grafana_data: