forked from connect-boiz/stellar-privacy-analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
169 lines (159 loc) · 3.81 KB
/
Copy pathdocker-compose.yml
File metadata and controls
169 lines (159 loc) · 3.81 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
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: stellar-postgres
environment:
POSTGRES_DB: stellar_db
POSTGRES_USER: stellar
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backend/database/migrations:/docker-entrypoint-initdb.d
networks:
- stellar-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U stellar -d stellar_db"]
interval: 30s
timeout: 10s
retries: 3
# Redis Cache and Service Discovery
redis:
image: redis:7-alpine
container_name: stellar-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
networks:
- stellar-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
# Backend API
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: stellar-backend
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://stellar:password@postgres:5432/stellar_db
- REDIS_URL=redis://redis:6379
- SERVICE_HOST=backend
- API_PORT=3001
- METRICS_PORT=9090
- AWS_REGION=us-east-1
ports:
- "3001:3001"
- "9090:9090"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./backend:/app
- /app/node_modules
networks:
- stellar-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Service Discovery Dashboard
service-discovery-dashboard:
build:
context: ./service-discovery-dashboard
dockerfile: Dockerfile
container_name: stellar-service-discovery-dashboard
environment:
- REDIS_URL=redis://redis:6379
- API_URL=http://backend:3001
ports:
- "3003:3000"
depends_on:
- backend
- redis
networks:
- stellar-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
# Frontend Application
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: stellar-frontend
environment:
- REACT_APP_API_URL=http://localhost:3001
ports:
- "3000:3000"
depends_on:
- backend
volumes:
- ./frontend:/app
- /app/node_modules
networks:
- stellar-network
# Nginx Reverse Proxy
nginx:
image: nginx:alpine
container_name: stellar-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/ssl:/etc/nginx/ssl
depends_on:
- frontend
- backend
networks:
- stellar-network
# Prometheus Monitoring
prometheus:
image: prom/prometheus:latest
container_name: stellar-prometheus
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
networks:
- stellar-network
# Grafana Dashboard
grafana:
image: grafana/grafana:latest
container_name: stellar-grafana
ports:
- "3002:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana/dashboards:/etc/grafana/provisioning/dashboards
depends_on:
- prometheus
networks:
- stellar-network
volumes:
postgres_data:
redis_data:
prometheus_data:
grafana_data:
networks:
stellar-network:
driver: bridge