forked from AgesEmpire/StellarSwipe-Backends
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
185 lines (173 loc) · 5.03 KB
/
docker-compose.yml
File metadata and controls
185 lines (173 loc) · 5.03 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
181
182
183
184
185
version: "3.8"
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: stellarswipe-postgres
environment:
POSTGRES_USER: ${DATABASE_USER:-postgres}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-password}
POSTGRES_DB: ${DATABASE_NAME:-stellarswipe}
ports:
- "${DATABASE_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- stellarswipe-network
# Redis Cache
redis:
image: redis:7-alpine
container_name: stellarswipe-redis
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
ports:
- "${REDIS_PORT:-6379}:6379"
command: redis-server --requirepass ${REDIS_PASSWORD:-}
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- stellarswipe-network
# NestJS Application (Development)
app:
build:
context: .
dockerfile: Dockerfile.dev
container_name: stellarswipe-app
environment:
NODE_ENV: development
PORT: 3000
HOST: 0.0.0.0
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_USER: ${DATABASE_USER:-postgres}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-password}
DATABASE_NAME: ${DATABASE_NAME:-stellarswipe}
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
STELLAR_NETWORK: ${STELLAR_NETWORK:-testnet}
STELLAR_HORIZON_URL: ${STELLAR_HORIZON_URL:-https://horizon-testnet.stellar.org}
STELLAR_SOROBAN_RPC_URL: ${STELLAR_SOROBAN_RPC_URL:-https://soroban-testnet.stellar.org:443}
STELLAR_NETWORK_PASSPHRASE: ${STELLAR_NETWORK_PASSPHRASE:-Test SDF Network ; September 2015}
ports:
- "3000:3000"
volumes:
- .:/app
- /app/node_modules
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- stellarswipe-network
command: npm run start:dev
environment:
TRACING_ENABLED: ${TRACING_ENABLED:-false}
JAEGER_OTLP_ENDPOINT: http://jaeger:4318/v1/traces
# Prometheus
prometheus:
image: prom/prometheus:v2.51.0
container_name: stellarswipe-prometheus
ports:
- "9090:9090"
volumes:
- ./infrastructure/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./infrastructure/monitoring/alerts.yml:/etc/prometheus/alerts.yml:ro
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.retention.time=15d'
- '--web.enable-lifecycle'
networks:
- stellarswipe-network
# Grafana
grafana:
image: grafana/grafana:10.4.0
container_name: stellarswipe-grafana
ports:
- "3001:3000"
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD:-admin}
GF_USERS_ALLOW_SIGN_UP: 'false'
volumes:
- grafana_data:/var/lib/grafana
- ./infrastructure/monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
- ./infrastructure/monitoring/grafana/dashboards:/etc/grafana/dashboards:ro
depends_on:
- prometheus
networks:
- stellarswipe-network
# Alertmanager
alertmanager:
image: prom/alertmanager:v0.27.0
container_name: stellarswipe-alertmanager
ports:
- "9093:9093"
volumes:
- ./infrastructure/monitoring/alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro
networks:
- stellarswipe-network
# Loki (log aggregation)
loki:
image: grafana/loki:2.9.0
container_name: stellarswipe-loki
ports:
- "3100:3100"
volumes:
- ./infrastructure/monitoring/loki.yml:/etc/loki/local-config.yaml:ro
- loki_data:/loki
command: -config.file=/etc/loki/local-config.yaml
networks:
- stellarswipe-network
# Jaeger (distributed tracing)
jaeger:
image: jaegertracing/all-in-one:1.56
container_name: stellarswipe-jaeger
ports:
- "16686:16686"
- "4318:4318"
environment:
COLLECTOR_OTLP_ENABLED: 'true'
networks:
- stellarswipe-network
# Postgres exporter
postgres-exporter:
image: prometheuscommunity/postgres-exporter:v0.15.0
container_name: stellarswipe-postgres-exporter
environment:
DATA_SOURCE_NAME: postgresql://${DATABASE_USER:-postgres}:${DATABASE_PASSWORD:-password}@postgres:5432/${DATABASE_NAME:-stellarswipe}?sslmode=disable
depends_on:
- postgres
networks:
- stellarswipe-network
# Redis exporter
redis-exporter:
image: oliver006/redis_exporter:v1.58.0
container_name: stellarswipe-redis-exporter
environment:
REDIS_ADDR: redis://redis:6379
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
depends_on:
- redis
networks:
- stellarswipe-network
volumes:
postgres_data:
redis_data:
prometheus_data:
grafana_data:
loki_data:
networks:
stellarswipe-network:
driver: bridge