-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
186 lines (178 loc) · 5.69 KB
/
docker-compose.yml
File metadata and controls
186 lines (178 loc) · 5.69 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
version: '3.8'
# Transaction Forensics - Docker Compose Configuration
#
# Services:
# - synthetic-data: Generates synthetic SAP SD documents
# - mcp-server: MCP server exposing SAP-shaped tools
# - pattern-engine: Pattern discovery and correlation engine
# - viewer: Web-based results viewer
#
# Usage:
# docker-compose up --build # Build and run all services
# docker-compose up synthetic-data # Run data generation only
# docker-compose up -d mcp-server # Run MCP server in background
# docker-compose logs -f pattern-engine # Follow pattern engine logs
# docker-compose down # Stop all services
services:
# ===========================================================================
# Synthetic Data Generator
# ===========================================================================
synthetic-data:
build:
context: ./synthetic-data
dockerfile: Dockerfile
container_name: tf-synthetic-data
volumes:
- ./synthetic-data/sample_output:/app/output
environment:
- DATA_COUNT=${DATA_COUNT:-10000}
- DATA_SEED=${DATA_SEED:-42}
- OUTPUT_DIR=/app/output
command: >
python src/generate_sd.py
--count ${DATA_COUNT:-10000}
--seed ${DATA_SEED:-42}
--output /app/output
networks:
- tf-network
# ===========================================================================
# MCP Server
# ===========================================================================
mcp-server:
build:
context: ./mcp-server
dockerfile: Dockerfile
container_name: tf-mcp-server
ports:
- "${SERVER_PORT:-3000}:3000"
volumes:
- ./synthetic-data/sample_output:/app/data:ro
- ./output/logs:/app/logs
environment:
- NODE_ENV=production
- PORT=3000
- DATA_DIR=/app/data
- LOG_DIR=/app/logs
depends_on:
synthetic-data:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
restart: unless-stopped
networks:
- tf-network
# ===========================================================================
# MCP Server with RFC Support (Profile: rfc)
# ===========================================================================
# This service requires:
# 1. SAP NW RFC SDK in mcp-server/nwrfc-sdk/
# 2. .env.rfc file with SAP connection parameters
#
# Usage:
# docker-compose --profile rfc up mcp-server-rfc
#
mcp-server-rfc:
build:
context: ./mcp-server
dockerfile: Dockerfile.rfc
container_name: tf-mcp-server-rfc
profiles:
- rfc
ports:
- "${RFC_SERVER_PORT:-3001}:3000"
volumes:
- ./output/logs:/app/logs
environment:
- NODE_ENV=production
- PORT=3000
- LOG_DIR=/app/logs
- SAP_ADAPTER=ecc_rfc
- SAP_RFC_ASHOST=${SAP_RFC_ASHOST}
- SAP_RFC_SYSNR=${SAP_RFC_SYSNR:-00}
- SAP_RFC_CLIENT=${SAP_RFC_CLIENT:-100}
- SAP_RFC_USER=${SAP_RFC_USER}
- SAP_RFC_PASSWD=${SAP_RFC_PASSWD}
- SAP_RFC_LANG=${SAP_RFC_LANG:-EN}
- SAP_RFC_POOL_SIZE=${SAP_RFC_POOL_SIZE:-5}
- SAP_RFC_TRACE=${SAP_RFC_TRACE:-0}
- SAP_RFC_TIMEOUT=${SAP_RFC_TIMEOUT:-30000}
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
restart: unless-stopped
networks:
- tf-network
# ===========================================================================
# Pattern Engine
# ===========================================================================
pattern-engine:
build:
context: ./pattern-engine
dockerfile: Dockerfile
container_name: tf-pattern-engine
volumes:
- ./synthetic-data/sample_output:/app/data:ro
- ./output:/app/output
environment:
- INPUT_DIR=/app/data
- OUTPUT_DIR=/app/output
- PYTHONUNBUFFERED=1
depends_on:
synthetic-data:
condition: service_completed_successfully
command: >
python -m src.main run
--input-dir /app/data
--output-dir /app/output
--mode shareable
networks:
- tf-network
# ===========================================================================
# Results Viewer
# ===========================================================================
viewer:
build:
context: ./viewer
dockerfile: Dockerfile
container_name: tf-viewer
ports:
- "${VIEWER_PORT:-8080}:8080"
volumes:
- ./output:/app/output:ro
environment:
- PORT=8080
- OUTPUT_DIR=/app/output
depends_on:
pattern-engine:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
restart: unless-stopped
networks:
- tf-network
# ===========================================================================
# Networks
# ===========================================================================
networks:
tf-network:
name: transaction-forensics
driver: bridge
# ===========================================================================
# Volumes (optional persistent storage)
# ===========================================================================
volumes:
synthetic-data-output:
name: tf-synthetic-data
analysis-output:
name: tf-analysis-output