-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
189 lines (179 loc) · 4.84 KB
/
docker-compose.yml
File metadata and controls
189 lines (179 loc) · 4.84 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: cyper-postgres
environment:
POSTGRES_DB: cyper_security
POSTGRES_USER: cyper_admin
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql
- ./database/migrations:/migrations
ports:
- "5432:5432"
networks:
- cyper-network
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U cyper_admin -d cyper_security" ]
interval: 10s
timeout: 5s
retries: 5
# Redis Cache & Queue
redis:
image: redis:7-alpine
container_name: cyper-redis
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-changeme}
volumes:
- redis_data:/data
ports:
- "6379:6379"
networks:
- cyper-network
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 10s
timeout: 5s
retries: 5
# Rust Core Engine
core:
build:
context: ./core
dockerfile: Dockerfile
container_name: cyper-core
privileged: true # Required for packet capture
network_mode: host # Required for network scanning
environment:
- RUST_LOG=info
- CORE_PORT=9090
volumes:
- ./scans:/scans
- ./logs/core:/var/log/cyper
depends_on:
- redis
restart: unless-stopped
# Go API Gateway
gateway:
build:
context: ./gateway
dockerfile: deployments/Dockerfile
container_name: cyper-gateway
environment:
- GIN_MODE=release
- DATABASE_URL=postgres://cyper_admin:${POSTGRES_PASSWORD:-changeme}@postgres:5432/cyper_security?sslmode=disable
- REDIS_URL=redis://:${REDIS_PASSWORD:-changeme}@redis:6379/0
- JWT_SECRET=${JWT_SECRET:-your-secret-key-change-in-production}
- CENTRAL_AUTH_SERVER_URL=${CENTRAL_AUTH_SERVER_URL:-http://auth-server:8000}
- CORE_ENGINE_URL=http://localhost:9090
- BRAIN_URL=http://brain:50051
ports:
- "8080:8080" # REST API
- "50051:50051" # gRPC
- "8081:8081" # WebSocket
networks:
- cyper-network
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
core:
condition: service_started
volumes:
- ./logs/gateway:/var/log/cyper
- ./audit_logs:/audit_logs
restart: unless-stopped
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/health" ]
interval: 30s
timeout: 10s
retries: 3
# Python Brain (AI & Orchestration)
brain:
build:
context: ./brain
dockerfile: Dockerfile
container_name: cyper-brain
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- DATABASE_URL=postgresql://cyper_admin:${POSTGRES_PASSWORD:-changeme}@postgres:5432/cyper_security
- REDIS_URL=redis://:${REDIS_PASSWORD:-changeme}@redis:6379/0
- GATEWAY_URL=http://gateway:8080
- PYTHONUNBUFFERED=1
ports:
- "50052:50051" # gRPC for AI services
networks:
- cyper-network
depends_on:
- postgres
- redis
- gateway
volumes:
- ./reports:/reports
- ./logs/brain:/var/log/cyper
- ./scans:/scans
restart: unless-stopped
# Celery Worker (for async tasks)
celery-worker:
build:
context: ./brain
dockerfile: Dockerfile
container_name: cyper-celery
command: celery -A cyper_brain.celery worker --loglevel=info
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- DATABASE_URL=postgresql://cyper_admin:${POSTGRES_PASSWORD:-changeme}@postgres:5432/cyper_security
- REDIS_URL=redis://:${REDIS_PASSWORD:-changeme}@redis:6379/0
networks:
- cyper-network
depends_on:
- redis
- postgres
- brain
volumes:
- ./reports:/reports
- ./logs/celery:/var/log/cyper
restart: unless-stopped
# React Dashboard
dashboard:
build:
context: ./dashboard
dockerfile: Dockerfile
container_name: cyper-dashboard
environment:
- REACT_APP_API_URL=http://localhost:8080/v1
- REACT_APP_WS_URL=ws://localhost:8081
ports:
- "3000:80"
networks:
- cyper-network
depends_on:
- gateway
restart: unless-stopped
# Nginx Reverse Proxy (optional, for SSL termination)
nginx:
image: nginx:alpine
container_name: cyper-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
- ./logs/nginx:/var/log/nginx
networks:
- cyper-network
depends_on:
- gateway
- dashboard
restart: unless-stopped
networks:
cyper-network:
driver: bridge
volumes:
postgres_data:
driver: local
redis_data:
driver: local