-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcompose.yaml
More file actions
141 lines (134 loc) · 3.36 KB
/
Copy pathcompose.yaml
File metadata and controls
141 lines (134 loc) · 3.36 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
name: smith
services:
api:
build:
context: .
dockerfile: api/dev.Dockerfile
container_name: smith-api
cap_add:
- NET_ADMIN
env_file:
- .env
environment:
- GLOBAL_BANDWIDTH_LIMIT=${GLOBAL_BANDWIDTH_LIMIT:-100}
ports:
- "8080:8080"
volumes:
# Mount source code for hot reloading
- ./api:/app/api
- ./cli:/app/cli
- ./e2e:/app/e2e
- ./models:/app/models
- ./smithd:/app/smithd
- ./updater:/app/updater
# Cache cargo registry and build artifacts for faster rebuilds
- cargo-registry:/usr/local/cargo/registry
- cargo-git:/usr/local/cargo/git
- target-cache:/app/target
- ./scripts/api-throttle.sh:/app/api-throttle.sh:ro
networks:
- backend
- device-network
depends_on:
postgres:
condition: service_healthy
postgres:
container_name: smith-postgres
build:
context: .
dockerfile: postgres.Dockerfile
env_file:
- .env
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- backend
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
bore:
image: ekzhang/bore
container_name: smith-bore
command: server --min-port 30000 --max-port 30100
ports:
- "7835:7835"
- "30000-30100:30000-30100"
networks:
- backend
- device-network
device:
build:
context: .
dockerfile: smithd/dev.Dockerfile
args:
# Override with ubuntu:22.04 for x86_64 Linux development
BASE_IMAGE: ${DEVICE_BASE_IMAGE:-nvcr.io/nvidia/l4t-base:r36.2.0}
privileged: true
cap_add:
- NET_ADMIN
volumes:
- ./scripts/network-throttle.sh:/app/network-throttle.sh:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- RUST_LOG=${RUST_LOG:-INFO}
- NETWORK_THROTTLE=${NETWORK_THROTTLE:-random}
entrypoint: ["/bin/bash", "-c", "printenv > /etc/smith/environment && /app/network-throttle.sh && exec /lib/systemd/systemd"]
tmpfs:
- /run
- /run/lock
- /tmp
deploy:
replicas: ${DEVICE_REPLICAS:-1}
networks:
- device-network
depends_on:
- api
- bore
smithd-builder:
build:
context: .
dockerfile: smithd/dev.Dockerfile
target: toolchain
args:
BASE_IMAGE: ${DEVICE_BASE_IMAGE:-nvcr.io/nvidia/l4t-base:r36.2.0}
container_name: smith-smithd-builder
volumes:
- .:/app
- smithd-cargo-registry:/root/.cargo/registry
- smithd-cargo-git:/root/.cargo/git
- smithd-target:/app/target
dashboard:
build:
context: .
dockerfile: dashboard/dev.Dockerfile
container_name: smith-dashboard
ports:
- "3000:3000"
volumes:
# Mount source code for hot reloading (dashboard + UI package)
- ./dashboard:/app/dashboard
- ./packages/ui:/app/packages/ui
# Cache node_modules for faster rebuilds
- node_modules-cache:/app/node_modules
networks:
- backend
depends_on:
- api
networks:
backend:
device-network:
# Simulates limited network on devices.
internal: true
volumes:
cargo-registry:
cargo-git:
target-cache:
postgres-data:
node_modules-cache:
smithd-cargo-registry:
smithd-cargo-git:
smithd-target: