-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
197 lines (186 loc) · 4.24 KB
/
docker-compose.yml
File metadata and controls
197 lines (186 loc) · 4.24 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
186
187
188
189
190
191
192
193
194
195
196
197
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: gtp_postgres
environment:
POSTGRES_DB: ${DATABASE_NAME:-global_truth_protocol}
POSTGRES_USER: ${DATABASE_USER:-gtp_user}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-gtp_password}
ports:
- "5434:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql
networks:
- gtp_network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER:-gtp_user}"]
interval: 10s
timeout: 5s
retries: 5
# Redis Cache
redis:
image: redis:7-alpine
container_name: gtp_redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- gtp_network
restart: unless-stopped
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
# MongoDB (for analytics)
mongodb:
image: mongo:7
container_name: gtp_mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER:-admin}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD:-admin}
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
networks:
- gtp_network
restart: unless-stopped
# IPFS Node
ipfs:
image: ipfs/kubo:latest
container_name: gtp_ipfs
ports:
- "4001:4001"
- "5001:5001"
- "8080:8080"
volumes:
- ipfs_data:/data/ipfs
networks:
- gtp_network
restart: unless-stopped
environment:
IPFS_PROFILE: server
# Backend API
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: gtp_backend
environment:
- NODE_ENV=${NODE_ENV:-development}
- DATABASE_HOST=postgres
- REDIS_HOST=redis
- MONGODB_URI=mongodb://admin:admin@mongodb:27017
ports:
- "8000:8000"
volumes:
- ./backend:/app
- /app/node_modules
networks:
- gtp_network
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
command: npm run dev
# AI Core Service
ai-core:
build:
context: ./ai-core
dockerfile: Dockerfile
container_name: gtp_ai_core
environment:
- PYTHON_ENV=${PYTHON_ENV:-development}
- DATABASE_HOST=postgres
- REDIS_HOST=redis
volumes:
- ./ai-core:/app
- ai_models:/app/models
- ai_checkpoints:/app/checkpoints
networks:
- gtp_network
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
command: python main.py
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
# Frontend (Next.js)
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: gtp_frontend
environment:
- NEXT_PUBLIC_API_URL=http://backend:8000
- NODE_ENV=${NODE_ENV:-development}
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- /app/node_modules
- /app/.next
networks:
- gtp_network
depends_on:
- backend
restart: unless-stopped
command: npm run dev
# Hardhat Node (local blockchain)
hardhat:
build:
context: ./smart-contracts
dockerfile: Dockerfile
container_name: gtp_hardhat
ports:
- "8545:8545"
volumes:
- ./smart-contracts:/app
- /app/node_modules
networks:
- gtp_network
restart: unless-stopped
command: npx hardhat node --hostname 0.0.0.0
# Nginx Reverse Proxy
nginx:
image: nginx:alpine
container_name: gtp_nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
networks:
- gtp_network
depends_on:
- frontend
- backend
restart: unless-stopped
networks:
gtp_network:
driver: bridge
volumes:
postgres_data:
redis_data:
mongodb_data:
ipfs_data:
ai_models:
ai_checkpoints: