forked from Haroldwonder/SwiftRemit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
146 lines (138 loc) · 4.43 KB
/
Copy pathdocker-compose.yml
File metadata and controls
146 lines (138 loc) · 4.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
142
143
144
145
146
# Local development stack.
#
# Each service reads its own .env file. Those files are gitignored — create them
# once with `make setup` (or ./scripts/setup-env.sh), which copies the tracked
# .env.example templates and fills in working local values.
#
# Never point env_file at a .env.example: the examples hold placeholders, so
# services would start with dummy configuration, and editing an example to make
# things work locally risks committing a real secret to a tracked file.
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-swiftremit}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-swiftremit}
POSTGRES_DB: ${POSTGRES_DB:-swiftremit}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-swiftremit}"]
interval: 5s
timeout: 5s
retries: 10
jaeger:
image: jaegertracing/all-in-one:1.58
restart: unless-stopped
ports:
- "16686:16686" # Jaeger UI
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
environment:
COLLECTOR_OTLP_ENABLED: "true"
backend:
build:
context: ./backend
dockerfile: Dockerfile
restart: unless-stopped
ports:
- "3001:3001"
environment:
NODE_ENV: development
PORT: 3001
DATABASE_URL: postgres://${POSTGRES_USER:-swiftremit}:${POSTGRES_PASSWORD:-swiftremit}@postgres:5432/${POSTGRES_DB:-swiftremit}
OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318
JAEGER_ENDPOINT: http://jaeger:4318
OTEL_SERVICE_NAME: swiftremit-backend
# SR-108: 100% sampling locally; override with 0.1 in production
OTEL_TRACES_SAMPLER: parentbased_traceidratio
OTEL_TRACES_SAMPLER_ARG: "1.0"
env_file:
- ./backend/.env
volumes:
- ./backend/src:/app/src
- ./backend/migrations:/app/migrations
depends_on:
postgres:
condition: service_healthy
jaeger:
condition: service_started
api:
build:
context: ./api
dockerfile: Dockerfile
restart: unless-stopped
ports:
- "3000:3000"
environment:
NODE_ENV: development
PORT: 3000
DATABASE_URL: postgres://${POSTGRES_USER:-swiftremit}:${POSTGRES_PASSWORD:-swiftremit}@postgres:5432/${POSTGRES_DB:-swiftremit}
OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318
JAEGER_ENDPOINT: http://jaeger:4318
OTEL_SERVICE_NAME: swiftremit-api
OTEL_TRACES_SAMPLER: parentbased_traceidratio
OTEL_TRACES_SAMPLER_ARG: "1.0"
env_file:
- ./api/.env
volumes:
- ./api/src:/app/src
depends_on:
postgres:
condition: service_healthy
jaeger:
condition: service_started
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
restart: unless-stopped
ports:
- "5173:5173"
environment:
VITE_API_URL: http://localhost:3000
VITE_BACKEND_URL: http://localhost:3001
env_file:
- ./frontend/.env
volumes:
- ./frontend/src:/app/src
- ./frontend/public:/app/public
depends_on:
- api
- backend
prometheus:
image: prom/prometheus:v2.52.0
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- ./backend/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
# Single source of truth for rules (SR-104) — see monitoring/.
- ./monitoring/alerts.yml:/etc/prometheus/alerts.yml:ro
- ./monitoring/slo.yml:/etc/prometheus/slo.yml:ro
command:
- --config.file=/etc/prometheus/prometheus.yml
grafana:
image: grafana/grafana:10.4.2
restart: unless-stopped
ports:
- "3003:3000"
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-admin}
volumes:
- grafana_data:/var/lib/grafana
# Datasource and dashboard providers are provisioned from files; nothing
# here is hand-created in the Grafana UI (SR-104). The dashboard JSON must
# live outside /etc/grafana/provisioning/dashboards, or it would shadow the
# provider config that points at it.
- ./monitoring/provisioning/datasources:/etc/grafana/provisioning/datasources:ro
- ./monitoring/provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro
- ./monitoring/dashboards:/var/lib/grafana/dashboards:ro
depends_on:
- prometheus
volumes:
postgres_data:
grafana_data: