Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
92 lines (92 loc) · 2.26 KB
/
Copy pathcompose.yaml
File metadata and controls
92 lines (92 loc) · 2.26 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
name: nod-local
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_USER: nod
POSTGRES_PASSWORD: ${NOD_POSTGRES_PASSWORD:?Run pnpm start from the repository root to set up and start Nod.}
POSTGRES_DB: nod
ports:
- '127.0.0.1:54329:5432'
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U nod']
interval: 2s
timeout: 3s
retries: 30
browser:
build:
context: .
dockerfile: Dockerfile.browser
container_name: nod-browser
hostname: nod-browser
init: true
cap_drop: [ALL]
security_opt: [no-new-privileges:true]
read_only: true
pids_limit: 4096
mem_limit: 8g
cpus: 6
shm_size: 1g
volumes:
- browser-data:/data
tmpfs:
- /tmp:size=1g
- /home/node:uid=1000,gid=1000,mode=700,size=256m
healthcheck:
test:
[
'CMD',
'node',
'-e',
'const s=require("node:net").connect("/data/control.sock");s.on("connect",()=>{s.end();process.exit(0)});s.on("error",()=>process.exit(1))',
]
interval: 2s
timeout: 3s
retries: 30
workspace:
build:
context: .
dockerfile: Dockerfile.workspace
image: nod-local-workspace
container_name: nod-workspace
init: true
cap_drop: [ALL]
security_opt: [no-new-privileges:true]
pids_limit: 4096
mem_limit: 8g
cpus: 4
volumes:
- ${NOD_DATA_ROOT:-./.local}/workspaces:/workspace
- workspace-tools:/home/node
network_mode: service:workspace-network
depends_on:
workspace-network:
condition: service_healthy
restart: true
command: ['sleep', 'infinity']
workspace-network:
image: nod-local-workspace
pull_policy: never
dns: [1.1.1.1, 8.8.8.8]
user: root
init: true
entrypoint: /usr/local/bin/nod-workspace-network
cap_drop: [ALL]
cap_add: [NET_ADMIN]
security_opt: [no-new-privileges:true]
read_only: true
tmpfs:
- /tmp:size=1m
pids_limit: 32
mem_limit: 64m
healthcheck:
test: ['CMD', 'test', '-f', '/tmp/network-ready']
interval: 2s
timeout: 3s
retries: 10
volumes:
postgres-data:
workspace-tools:
browser-data: