-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
141 lines (136 loc) · 3.7 KB
/
Copy pathdocker-compose.yml
File metadata and controls
141 lines (136 loc) · 3.7 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
services:
sandbox:
build:
context: ./sandbox
container_name: linuxpath-sandbox
restart: unless-stopped
hostname: linuxpath
networks:
- internal
- egress
volumes:
- sandbox-data:/home/learner
cap_add:
- SYS_PTRACE
mem_limit: 768m
cpus: "0.75"
backend:
build:
context: ./backend
container_name: linuxpath-backend
restart: unless-stopped
environment:
NODE_ENV: ${NODE_ENV:-production}
PORT: ${PORT:-4000}
DATA_DIR: ${DATA_DIR:-/app/data}
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:3000}
SESSION_SECRET: ${SESSION_SECRET:-change_this_to_a_random_string_32chars}
SANDBOX_CONTAINER: ${SANDBOX_CONTAINER:-linuxpath-sandbox}
SANDBOX_MAX_SESSIONS: ${SANDBOX_MAX_SESSIONS:-3}
TERMINAL_IDLE_TIMEOUT_MS: ${TERMINAL_IDLE_TIMEOUT_MS:-1800000}
AI_ENABLED: ${AI_ENABLED:-false}
AI_PROVIDER: ${AI_PROVIDER:-none}
GROQ_API_KEY: ${GROQ_API_KEY:-}
GROQ_MODEL: ${GROQ_MODEL:-llama-3.3-70b-versatile}
OPENAI_COMPATIBLE_API_KEY: ${OPENAI_COMPATIBLE_API_KEY:-}
OPENAI_COMPATIBLE_BASE_URL: ${OPENAI_COMPATIBLE_BASE_URL:-}
OPENAI_COMPATIBLE_MODEL: ${OPENAI_COMPATIBLE_MODEL:-}
OLLAMA_BASE_URL: ${OLLAMA_BASE_URL:-http://host.docker.internal:11434}
OLLAMA_MODEL: ${OLLAMA_MODEL:-llama3.1}
AI_RATE_LIMIT_MAX: ${AI_RATE_LIMIT_MAX:-20}
AI_TIMEOUT_MS: ${AI_TIMEOUT_MS:-20000}
AI_MAX_CONTEXT_CHARS: ${AI_MAX_CONTEXT_CHARS:-6000}
RATE_LIMIT_WINDOW_MS: ${RATE_LIMIT_WINDOW_MS:-60000}
RATE_LIMIT_MAX: ${RATE_LIMIT_MAX:-180}
RATE_LIMIT_READ_MAX: ${RATE_LIMIT_READ_MAX:-600}
EVENT_LOG_LIMIT: ${EVENT_LOG_LIMIT:-5000}
COMMAND_HISTORY_LIMIT: ${COMMAND_HISTORY_LIMIT:-2000}
TERMINAL_SNAPSHOT_LINES: ${TERMINAL_SNAPSHOT_LINES:-40}
ports:
- "${BACKEND_PORT:-4000}:4000"
networks:
- app
- internal
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- learning-data:/app/data
depends_on:
- sandbox
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://127.0.0.1:4000/health').then((r)=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))",
]
start_period: 20s
interval: 30s
timeout: 10s
retries: 3
frontend:
build:
context: ./frontend
container_name: linuxpath-frontend
restart: unless-stopped
environment:
VITE_API_BASE_URL: /api
VITE_WS_BASE_URL: /ws
expose:
- "80"
networks:
- app
depends_on:
backend:
condition: service_healthy
healthcheck:
test:
[
"CMD",
"bun",
"-e",
"fetch('http://127.0.0.1:80').then((r)=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))",
]
start_period: 20s
interval: 10s
timeout: 5s
retries: 12
middleware:
build:
context: ./middleware
container_name: linuxpath-middleware
restart: unless-stopped
ports:
- "${APP_PORT:-3000}:80"
networks:
- app
depends_on:
backend:
condition: service_healthy
frontend:
condition: service_healthy
healthcheck:
test:
[
"CMD-SHELL",
"wget -qO- http://127.0.0.1/health >/dev/null 2>&1 || exit 1",
]
start_period: 10s
interval: 10s
timeout: 5s
retries: 6
networks:
app:
name: linuxpath-app
internal:
name: linuxpath-internal
internal: true
egress:
name: linuxpath-egress
volumes:
sandbox-data:
name: linuxpath-sandbox-data
learning-data:
name: linuxpath-learning-data