-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
170 lines (154 loc) · 4.12 KB
/
Copy pathdocker-compose.yml
File metadata and controls
170 lines (154 loc) · 4.12 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
version: '3.8'
services:
# API Gateway (Go)
gateway:
container_name: va_api_gateway_go
image: valtunox/api-gateway:latest
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
environment:
# Framework
- GATEWAY_PORT=:9777
- JWT_SECRET=${JWT_SECRET:-your-secret-key-change-in-production}
# Rate Limiting & DDoS Protection
- MAX_REQUESTS_PER_SECOND=100
- MAX_BURST_SIZE=200
- DDOS_THRESHOLD=1000
# Redis
- REDIS_ADDR=redis:6379
# Load Balancing
- LOAD_BALANCING_ALGO=least-conn
# Caching
- ENABLE_CACHING=${ENABLE_CACHING:-true}
- CACHE_TTL=5m
# CORS
- CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS:-["*"]}
# Service Routes
- ROUTE_INFINITY_URL=http://infinity-ai:8000
- ROUTE_INFINITY_PREFIX=/api/infinity
- ROUTE_LLM_URL=http://va-llm:8745
- ROUTE_LLM_PREFIX=/api/llm
- ROUTE_STUDIO_URL=http://va-studio:8000
- ROUTE_STUDIO_PREFIX=/api/studio
- ROUTE_ADMIN_URL=http://va-admin:8742
- ROUTE_ADMIN_PREFIX=/api/admin
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "80:80" # nginx HTTP — public entry point
- "9777:9777" # Go/Gin API — direct access (optional)
volumes:
- type: bind
source: ./nginx/nginx.conf
target: /etc/nginx/nginx.conf
read_only: true
- type: bind
source: ./nginx/static
target: /usr/share/nginx/html
consistency: cached
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9777/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
depends_on:
redis:
condition: service_healthy
jaeger:
condition: service_started
prometheus:
condition: service_started
networks:
- gateway_network
- va-services
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
cpus: "2"
memory: 2G
reservations:
memory: 512M
# Redis for caching and rate limiting
redis:
image: redis:7-alpine
container_name: va_redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- gateway_network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
# Prometheus for metrics
prometheus:
image: prom/prometheus:latest
container_name: va_prometheus
ports:
- "9090:9090"
volumes:
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
networks:
- gateway_network
restart: unless-stopped
# Grafana for visualization
grafana:
image: grafana/grafana:latest
container_name: va_grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- grafana_data:/var/lib/grafana
- ./config/grafana/dashboards:/etc/grafana/provisioning/dashboards
- ./config/grafana/datasources:/etc/grafana/provisioning/datasources
networks:
- gateway_network
restart: unless-stopped
depends_on:
- prometheus
# Jaeger for distributed tracing
jaeger:
image: jaegertracing/all-in-one:latest
container_name: va_jaeger
ports:
- "5775:5775/udp"
- "6831:6831/udp"
- "6832:6832/udp"
- "5778:5778"
- "16686:16686" # Jaeger UI
- "14268:14268"
- "14250:14250"
- "9411:9411"
environment:
- COLLECTOR_ZIPKIN_HOST_PORT=:9411
networks:
- gateway_network
restart: unless-stopped
networks:
gateway_network:
driver: bridge
va-services:
driver: bridge
name: va-services
volumes:
redis_data:
prometheus_data:
grafana_data: