-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
117 lines (110 loc) · 3.08 KB
/
Copy pathdocker-compose.yml
File metadata and controls
117 lines (110 loc) · 3.08 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
version: "3.8"
services:
# Entity 1: ZK Proof Generation Service
zkproof-service:
build:
context: ./entity1-zkproof
dockerfile: Dockerfile
container_name: zkproof-service
ports:
- "${ZK_SERVICE_PORT:-8001}:${ZK_SERVICE_PORT:-8001}"
environment:
- RUST_LOG=${RUST_LOG:-info}
- RISC0_DEV_MODE=${RISC0_DEV_MODE:-0}
- ZK_PROOF_CACHE_TTL=${ZK_PROOF_CACHE_TTL:-3600}
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
volumes:
- ./data:/app/data
networks:
- zkp-llm-network
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
runtime: nvidia
# Entity 2: LLM Advisor Service
llm-advisor:
build:
context: ./entity2-llm
dockerfile: Dockerfile
container_name: llm-advisor
ports:
- "${LLM_SERVICE_PORT:-8002}:${LLM_SERVICE_PORT:-8002}"
environment:
- MODEL_PATH=${MODEL_PATH:-/app/models}
- ZKPROOF_SERVICE_URL=${ZKPROOF_SERVICE_URL:-http://zkproof-service:8001}
- CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-0}
- MODEL_NAME=${MODEL_NAME:-llama-2-7b-chat}
- MODEL_TEMPERATURE=${MODEL_TEMPERATURE:-0.7}
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
- JWT_SECRET=${JWT_SECRET}
- LOG_LEVEL=${LOG_LEVEL:-info}
volumes:
- ./models:/app/models
- ./data:/app/data
depends_on:
- zkproof-service
networks:
- zkp-llm-network
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
runtime: nvidia
# Web Interface for demonstration
web-interface:
build:
context: ./web-interface
dockerfile: Dockerfile
container_name: web-interface
ports:
- "${WEB_PORT:-3000}:3000"
environment:
- REACT_APP_LLM_SERVICE_URL=${REACT_APP_LLM_SERVICE_URL:-http://localhost:8002}
- REACT_APP_ZK_SERVICE_URL=${REACT_APP_ZK_SERVICE_URL:-http://localhost:8001}
- REACT_APP_API_TIMEOUT=${REACT_APP_API_TIMEOUT:-30000}
depends_on:
- llm-advisor
- zkproof-service
networks:
- zkp-llm-network
# Redis for caching proofs and session management
redis:
image: redis:7-alpine
container_name: redis-cache
ports:
- "${REDIS_PORT:-6379}:6379"
command: redis-server --requirepass ${REDIS_PASSWORD}
volumes:
- redis-data:/data
networks:
- zkp-llm-network
# PostgreSQL for storing user traits and audit logs
postgres:
image: postgres:15
container_name: postgres-db
environment:
- POSTGRES_DB=${POSTGRES_DB:-zkp_llm}
- POSTGRES_USER=${POSTGRES_USER:-zkp_user}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- zkp-llm-network
networks:
zkp-llm-network:
driver: bridge
volumes:
redis-data:
postgres-data: