Repository navigation
Expand file tree
/
Copy pathdocker-compose.ml.yml
More file actions
105 lines (99 loc) · 2.72 KB
/
Copy pathdocker-compose.ml.yml
File metadata and controls
105 lines (99 loc) · 2.72 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
version: "3.8"
# INEC ML Infrastructure Stack
# Run with: docker-compose -f docker-compose.ml.yml up
services:
# Python ML Inference Server (PaddleOCR, InsightFace, CDCN, GNN)
ml-inference:
restart: unless-stopped
build:
context: ./ml
dockerfile: Dockerfile
ports:
- "8090:8090"
environment:
- MODELS_DIR=/app/models
- PYTHONPATH=/app
volumes:
- ml-models:/app/models
deploy:
resources:
limits:
memory: 4G
cpus: "4"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8090/health')"]
interval: 30s
timeout: 10s
retries: 3
# Rust High-Performance Inference Engine (ONNX Runtime, batch scoring)
rust-inference:
restart: unless-stopped
build:
context: ./services/inference-engine
ports:
- "8091:8091"
environment:
- MODELS_DIR=/app/models
- NEO4J_URI=bolt://neo4j:7687
- NEO4J_USER=neo4j
- NEO4J_PASSWORD=${NEO4J_PASSWORD:?NEO4J_PASSWORD must be set}
- RUST_LOG=info
volumes:
- ml-models:/app/models
depends_on:
- neo4j
deploy:
resources:
limits:
memory: 2G
cpus: "4"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8091/health"]
interval: 30s
timeout: 5s
retries: 3
# Neo4j Graph Database (polling unit adjacency, fraud rings)
neo4j:
restart: unless-stopped
image: neo4j:5.17-community
ports:
- "127.0.0.1:7474:7474" # Browser (loopback only)
- "127.0.0.1:7687:7687" # Bolt (loopback only)
environment:
- NEO4J_AUTH=neo4j/${NEO4J_PASSWORD:?NEO4J_PASSWORD must be set}
- NEO4J_PLUGINS=["apoc"]
- NEO4J_server_memory_heap_initial__size=512m
- NEO4J_server_memory_heap_max__size=1G
volumes:
- neo4j-data:/data
deploy:
resources:
limits:
memory: 2G
# Model Training (run once to generate model weights)
train:
restart: "no" # one-shot training job (profiles: training); must not auto-restart
build:
context: ./ml
dockerfile: Dockerfile
command: >
bash -c "
python training/anomaly_detection/train.py --output /app/models &&
python training/liveness_pad/train.py --output /app/models --epochs 10 &&
python training/gnn_network/train.py --output /app/models --epochs 50 &&
python training/face_recognition/train.py --action metadata
"
volumes:
- ml-models:/app/models
profiles:
- training
deploy:
resources:
limits:
memory: 4G
cpus: "4"
volumes:
ml-models:
name: inec-ml-models
neo4j-data:
name: inec-neo4j-data