-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
135 lines (129 loc) · 3.87 KB
/
docker-compose.yml
File metadata and controls
135 lines (129 loc) · 3.87 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
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: tracepcap-postgres
environment:
POSTGRES_DB: tracepcap
POSTGRES_USER: tracepcap_user
POSTGRES_PASSWORD: tracepcap_pass
TZ: Asia/Singapore
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tracepcap_user -d tracepcap"]
interval: 10s
timeout: 5s
retries: 5
networks:
- tracepcap-network
# MinIO Object Storage
minio:
image: minio/minio:latest
container_name: tracepcap-minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
TZ: Asia/Singapore
ports:
- "9000:9000" # API
- "9001:9001" # Console
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
networks:
- tracepcap-network
# MinIO Client (mc) - Create bucket on startup
minio-init:
image: minio/mc:latest
container_name: tracepcap-minio-init
depends_on:
- minio
entrypoint: >
/bin/sh -c "
sleep 5;
/usr/bin/mc alias set myminio http://minio:9000 minioadmin minioadmin;
/usr/bin/mc mb myminio/tracepcap-files --ignore-existing;
/usr/bin/mc anonymous set public myminio/tracepcap-files;
exit 0;
"
networks:
- tracepcap-network
# Spring Boot Backend
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: tracepcap-backend
environment:
SPRING_PROFILES_ACTIVE: dev
DATABASE_URL: jdbc:postgresql://postgres:5432/tracepcap
DATABASE_USERNAME: tracepcap_user
DATABASE_PASSWORD: tracepcap_pass
MINIO_ENDPOINT: http://minio:9000
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
MINIO_BUCKET: tracepcap-files
# Memory allocation — all limits (JVM heap, max upload, timeouts) are derived
# from this single value in the container entrypoint script
APP_MEMORY_MB: ${APP_MEMORY_MB:-2048}
# LLM Configuration (OpenAI API Format)
LLM_API_BASE_URL: ${LLM_API_BASE_URL:-https://api.openai.com/v1}
LLM_API_KEY: ${LLM_API_KEY:-your-api-key-here}
LLM_MODEL: ${LLM_MODEL:-gpt-4}
LLM_TEMPERATURE: ${LLM_TEMPERATURE:-0.7}
LLM_MAX_TOKENS: ${LLM_MAX_TOKENS:-2000}
LLM_CONTEXT_LENGTH: ${LLM_CONTEXT_LENGTH:-}
LLM_TIMEOUT: ${LLM_TIMEOUT:-300}
# Timezone Configuration
TZ: Asia/Singapore
volumes:
- config_data:/app/config
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
networks:
- tracepcap-network
# Nginx - Serves frontend and proxies API to backend
nginx:
build:
context: .
dockerfile: ./nginx/Dockerfile
args:
VITE_API_BASE_URL: /api
VITE_SUPPORTED_FILE_TYPES: ${VITE_SUPPORTED_FILE_TYPES:-.pcap,.pcapng,.cap}
VITE_ANALYSIS_OPTIONS: ${VITE_ANALYSIS_OPTIONS:-false}
VITE_NETWORK_DIAGRAM_CONVERSATION_LIMIT: ${VITE_NETWORK_DIAGRAM_CONVERSATION_LIMIT:-false}
container_name: tracepcap-nginx
environment:
# Memory allocation — nginx body limit and timeouts derived from this
APP_MEMORY_MB: ${APP_MEMORY_MB:-2048}
# LLM timeout — nginx proxy_read_timeout is set to max(memory-derived, LLM_TIMEOUT+60s)
LLM_TIMEOUT: ${LLM_TIMEOUT:-300}
# Timezone Configuration
TZ: Asia/Singapore
ports:
- "${NGINX_PORT:-80}:80"
depends_on:
- backend
networks:
- tracepcap-network
volumes:
postgres_data:
driver: local
minio_data:
driver: local
config_data:
driver: local
networks:
tracepcap-network:
driver: bridge