-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
118 lines (111 loc) · 2.76 KB
/
Copy pathdocker-compose.yml
File metadata and controls
118 lines (111 loc) · 2.76 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
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: edgeai-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USER:-edgeai}
POSTGRES_PASSWORD: ${DB_PASSWORD:-edgeai_secret}
POSTGRES_DB: ${DB_NAME:-edgeai}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d:ro
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-edgeai} -d ${DB_NAME:-edgeai}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- edgeai-network
# Cloud Server (Receives aggregated data from edge agents)
cloud-server:
build:
context: .
dockerfile: docker/cloud-server.Dockerfile
container_name: edgeai-cloud
restart: unless-stopped
environment:
RUST_LOG: info
DATABASE__URL: postgres://${DB_USER:-edgeai}:${DB_PASSWORD:-edgeai_secret}@postgres:5432/${DB_NAME:-edgeai}
HTTP_PORT: 8080
GRPC_PORT: 50051
ports:
- "8080:8080"
- "50051:50051"
depends_on:
postgres:
condition: service_healthy
networks:
- edgeai-network
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
# Edge Agent (Runs on same VM for MVP - Phase 1)
edge-agent:
build:
context: .
dockerfile: docker/edge-agent.Dockerfile
container_name: edgeai-agent
restart: unless-stopped
environment:
RUST_LOG: info
AGENT_ID: agent-local-mvp
CLOUD_ENDPOINT: http://cloud-server:50051
WINDOW_SECONDS: 60
ANOMALY_THRESHOLD: 70.0
volumes:
- ./test-data:/data:ro
- agent_buffer:/var/lib/edgeai
depends_on:
- cloud-server
networks:
- edgeai-network
command: ["--test-file", "/data/test-events.jsonl"]
# React Frontend Dashboard
dashboard:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: edgeai-dashboard
restart: unless-stopped
environment:
VITE_API_URL: http://localhost:8080
ports:
- "3000:80"
depends_on:
- cloud-server
networks:
- edgeai-network
# Nginx Reverse Proxy (Optional - for production)
nginx:
image: nginx:alpine
container_name: edgeai-nginx
restart: unless-stopped
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- cloud-server
- dashboard
networks:
- edgeai-network
profiles:
- production
volumes:
postgres_data:
driver: local
agent_buffer:
driver: local
networks:
edgeai-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16