-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
165 lines (155 loc) · 4.05 KB
/
docker-compose.yml
File metadata and controls
165 lines (155 loc) · 4.05 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
# FluxAI Gateway - Docker Compose Development Environment
# Complete stack: API Gateway, Database, Cache, Observability, Dashboard
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: fluxai-postgres
environment:
POSTGRES_DB: fluxai
POSTGRES_USER: fluxai
POSTGRES_PASSWORD: dev_password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U fluxai"]
interval: 10s
timeout: 5s
retries: 5
networks:
- fluxai-network
# Redis Cache
redis:
image: redis:7-alpine
container_name: fluxai-redis
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- fluxai-network
# FluxAI API Gateway
api:
build:
context: .
dockerfile: Dockerfile
container_name: fluxai-api
ports:
- "8080:8080"
environment:
- DATABASE_URL=postgresql+asyncpg://fluxai:dev_password@postgres:5432/fluxai
- REDIS_URL=redis://redis:6379/0
- AWS_REGION=${AWS_REGION:-us-east-1}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- ENVIRONMENT=development
- DEBUG=true
- LOG_LEVEL=INFO
- OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4317
- PROMETHEUS_MULTIPROC_DIR=/tmp/prometheus
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./app:/app/app
- ./.env:/app/.env
command: uvicorn app.main:app --host 0.0.0.0 --port 8080 --reload
networks:
- fluxai-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Prometheus Metrics
prometheus:
image: prom/prometheus:latest
container_name: fluxai-prometheus
ports:
- "9090:9090"
volumes:
- ./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'
depends_on:
- api
networks:
- fluxai-network
# Grafana Dashboards
grafana:
image: grafana/grafana:latest
container_name: fluxai-grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_INSTALL_PLUGINS=
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
networks:
- fluxai-network
# Jaeger Tracing (OpenTelemetry)
jaeger:
image: jaegertracing/all-in-one:latest
container_name: fluxai-jaeger
ports:
- "16686:16686" # Jaeger UI
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
environment:
- COLLECTOR_OTLP_ENABLED=true
networks:
- fluxai-network
# Streamlit Dashboard
dashboard:
build:
context: .
dockerfile: Dockerfile.dashboard
container_name: fluxai-dashboard
ports:
- "8501:8501"
environment:
- PROMETHEUS_URL=http://prometheus:9090
- DATABASE_URL=postgresql://fluxai:dev_password@postgres:5432/fluxai
- JAEGER_URL=http://jaeger:16686
- AUTO_REFRESH=true
- REFRESH_INTERVAL=30
depends_on:
- prometheus
- postgres
- api
networks:
- fluxai-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8501/_stcore/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
fluxai-network:
driver: bridge
volumes:
postgres_data:
redis_data:
prometheus_data:
grafana_data: