forked from openclaw/openclaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.secure.yml
More file actions
74 lines (70 loc) · 1.85 KB
/
Copy pathdocker-compose.secure.yml
File metadata and controls
74 lines (70 loc) · 1.85 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
version: '3.8'
# ============================================
# CLAWD SECURE - DOCKER COMPOSE
# Full stack with security hardening
# ============================================
services:
# Docker Socket Proxy (Directive 2)
# Provides controlled access to Docker API
socket-proxy:
image: tecnativa/docker-socket-proxy:latest
container_name: clawd-socket-proxy
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- CONTAINERS=1
- IMAGES=0
- NETWORKS=0
- VOLUMES=0
- POST=0
- DELETE=0
networks:
- clawd-internal
security_opt:
- no-new-privileges:true
# Main Application (Moltbot + Clawd Secure)
clawd-secure:
build:
context: .
dockerfile: Dockerfile.secure
container_name: clawd-secure-moltbot
restart: unless-stopped
user: "1001:1001" # clawduser
ports:
- "127.0.0.1:3000:3000" # Bind to localhost ONLY
env_file:
- .env
environment:
- NODE_ENV=production
- DOCKER_HOST=tcp://socket-proxy:2375
volumes:
- ./data:/app/data
- ./sessions:/app/sessions
depends_on:
- socket-proxy
networks:
- clawd-internal
cap_drop:
- ALL
cap_add:
- NET_BIND_SERVICE
security_opt:
- no-new-privileges:true
read_only: false # Set to true if you don't need write access
tmpfs:
- /tmp:noexec,nosuid,nodev,size=100m
healthcheck:
test: [ "CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))" ]
interval: 30s
timeout: 10s
start_period: 40s
retries: 3
# Networks
networks:
clawd-internal:
driver: bridge
internal: false # Set to true for complete isolation (no internet)
ipam:
config:
- subnet: 172.20.0.0/16