-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
79 lines (77 loc) · 2.16 KB
/
Copy pathdocker-compose.yml
File metadata and controls
79 lines (77 loc) · 2.16 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
services:
dev:
build:
context: .
target: dev
volumes:
- .:/workspace
- cargo-registry:/usr/local/cargo/registry
- cargo-git:/usr/local/cargo/git
- target-cache:/workspace/target
- key-server-build:/workspace/packages/key-server/build
- xpose-bin:/root/.xpose/bin
tmpfs:
- /tmp/sccache:size=512m,mode=1777
- /tmp:size=1g,mode=1777
environment:
- MT_TUNNEL_PORT=3000
- SCCACHE_DIR=/tmp/sccache
- RUSTC_WRAPPER=sccache
- CARGO_HOME=/usr/local/cargo
- CLOUDFLARE_API_TOKEN # Required by wrangler internally (mapped from WORKER_TOKEN in CI)
- CLOUDFLARE_API_WORKER_TOKEN
stdin_open: true
tty: true
shm_size: 2gb
cpu_shares: 1024
mem_limit: 8g
healthcheck:
test: [ "CMD", "cargo", "--version" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Local development: Key Server (wrangler dev --local)
# Usage: docker compose up key-server-dev
key-server-dev:
build:
context: .
target: dev
volumes:
- .:/workspace
- cargo-registry:/usr/local/cargo/registry
- cargo-git:/usr/local/cargo/git
- target-cache:/workspace/target
- key-server-build:/workspace/packages/key-server/build
- xpose-bin:/root/.xpose/bin
tmpfs:
- /tmp/sccache:size=512m,mode=1777
- /tmp:size=1g,mode=1777
working_dir: /workspace/packages/key-server
command: >
bash -c "
echo '🔨 Building key-server worker...' &&
worker-build --release &&
echo '🚀 Starting wrangler dev on port 8787...' &&
wrangler dev --config wrangler.jsonc --local --persist --d1 DB --port 8787 --non-interactive --ip 0.0.0.0
"
ports:
- "8787:8787"
environment:
- CARGO_HOME=/usr/local/cargo
- RUSTC_WRAPPER=sccache
- SCCACHE_DIR=/tmp/sccache
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8787/api/config"]
interval: 10s
timeout: 5s
retries: 15
start_period: 120s
mem_limit: 4g
shm_size: 1gb
volumes:
cargo-registry:
cargo-git:
target-cache:
key-server-build:
xpose-bin: