forked from opensandbox-group/OpenSandbox
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.example.yaml
More file actions
65 lines (56 loc) · 1.99 KB
/
docker-compose.example.yaml
File metadata and controls
65 lines (56 loc) · 1.99 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
configs:
opensandbox-config:
content: |
[server]
host = "0.0.0.0"
port = 8090
[log]
level = "INFO"
[runtime]
type = "docker"
# execd_image = "opensandbox/execd:v1.0.18"
execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:v1.0.18"
[egress]
image = "opensandbox/egress:v1.0.12"
# image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:v1.0.12"
[docker]
network_mode = "bridge"
# When server runs in a container, set host_ip to the host's IP or hostname so bridge-mode endpoints are reachable (e.g. host.docker.internal or the host LAN IP).
# It's required when server deployed with docker container under host.
host_ip = "host.docker.internal"
drop_capabilities = ["AUDIT_WRITE", "MKNOD", "NET_ADMIN", "NET_RAW", "SYS_ADMIN", "SYS_MODULE", "SYS_PTRACE", "SYS_TIME", "SYS_TTY_CONFIG"]
no_new_privileges = true
# TODO: For production environments, it is recommended to set this to '4096' or higher to avoid
# "can't start new thread" errors when multiple sandboxes are running concurrently.
# See: https://github.com/alibaba/OpenSandbox/issues/447
pids_limit = 4096
[ingress]
mode = "direct"
version: '3.8'
services:
opensandbox-server:
image: opensandbox/server:latest
container_name: opensandbox-server
networks:
- opensandbox-net
ports:
- "8090:8090"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
- source: opensandbox-config
target: /etc/opensandbox/config.toml
environment:
- SANDBOX_CONFIG_PATH=/etc/opensandbox/config.toml
sdk-client:
image: python:3.11-slim
container_name: sdk-client
networks:
- opensandbox-net
command: >
sh -c "pip install opensandbox && tail -f /dev/null"
environment:
- OPENSANDBOX_SERVER_URL=http://opensandbox-server:8090
networks:
opensandbox-net:
driver: bridge