forked from Kevin737866/-stellar-analytics-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
147 lines (139 loc) · 3.34 KB
/
Copy pathdocker-compose.yml
File metadata and controls
147 lines (139 loc) · 3.34 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
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: stellar-analytics-postgres
environment:
POSTGRES_DB: stellar_analytics
POSTGRES_USER: stellar_user
POSTGRES_PASSWORD: stellar_password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./packages/indexer/src/database/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql
networks:
- stellar-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U stellar_user -d stellar_analytics"]
interval: 30s
timeout: 10s
retries: 3
# Redis Cache
redis:
image: redis:7-alpine
container_name: stellar-analytics-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- stellar-network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
# Indexer Service
indexer:
build:
context: .
dockerfile: packages/indexer/Dockerfile
container_name: stellar-analytics-indexer
environment:
NODE_ENV: production
DATABASE_URL: postgresql://stellar_user:stellar_password@postgres:5432/stellar_analytics
REDIS_URL: redis://redis:6379
STELLAR_NETWORK: public
STELLAR_HORIZON_URL: https://horizon.stellar.org
PORT: 3001
LOG_LEVEL: info
ports:
- "3001:3001"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- stellar-network
restart: unless-stopped
volumes:
- indexer_logs:/app/logs
# GraphQL API Server
api:
build:
context: .
dockerfile: packages/api/Dockerfile
container_name: stellar-analytics-api
environment:
NODE_ENV: production
DATABASE_URL: postgresql://stellar_user:stellar_password@postgres:5432/stellar_analytics
REDIS_URL: redis://redis:6379
PORT: 4000
LOG_LEVEL: info
CORS_ORIGIN: http://localhost:3000
ports:
- "4000:4000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- stellar-network
restart: unless-stopped
volumes:
- api_logs:/app/logs
# Frontend Application
frontend:
build:
context: .
dockerfile: packages/frontend/Dockerfile
container_name: stellar-analytics-frontend
environment:
VITE_API_URL: http://localhost:4000/graphql
VITE_WS_URL: ws://localhost:4000/graphql
ports:
- "3000:80"
depends_on:
- api
networks:
- stellar-network
restart: unless-stopped
# Nginx Reverse Proxy (Optional)
nginx:
image: nginx:alpine
container_name: stellar-analytics-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
depends_on:
- frontend
- api
networks:
- stellar-network
restart: unless-stopped
profiles:
- production
volumes:
postgres_data:
driver: local
redis_data:
driver: local
indexer_logs:
driver: local
api_logs:
driver: local
networks:
stellar-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16