-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
156 lines (122 loc) · 3.27 KB
/
docker-compose.yml
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
services:
# The Edge AI service
# run: `docker-compose build` to update the service
# run: `docker-compose up -d` to launch the service
processor:
image: stakach/edge-ai
# build: .
restart: always
# network, host mode as we need multicast support
container_name: processor
hostname: processor
network_mode: "host"
# processor has a custom entry point
entrypoint: /processor
command: []
volumes:
- ./config/:/config/
# the unix pipes for IPC
- ./detections/:/detections/
# AI model storage (downloaded based on config)
- ./model_storage/:/model_storage/
# we need to map in all the USB devices
# as edge TPU device name changes when initialized
- /dev/:/dev/
# mapping dev and configuring privileged access is
# the simplest way to support a wide range of hardware
privileged: true
deploy:
resources:
limits:
cpus: '2'
reservations:
cpus: '1'
cpuset: "0" # Pin the container to CPU core 0
# on a pi logging slows the system down too much
# really need to move all logging into memory
logging:
driver: "none"
environment:
SG_ENV: "production"
interface:
image: stakach/edge-ai
# build: .
restart: always
# network
container_name: interface
hostname: interface
network_mode: "host"
volumes:
- ./clips/:/clips/
- ./config/:/config/
- ./detections/:/detections/
- /mnt/ramdisk:/mnt/ramdisk
# we need to map in all the USB devices
# as edge TPU device name changes when initialized
- /dev/:/dev/
# required to open GPIO chips
devices:
- "/dev/gpiochip0:/dev/gpiochip0"
# required to inspect GPIO chips
cap_add:
- SYS_RAWIO
# Not required when using host network mode
# ports:
# - "3000:3000"
logging:
driver: "none"
recorder:
image: stakach/edge-ai
# build: .
restart: always
# network, host mode as we need multicast support
container_name: recorder
hostname: recorder
network_mode: "host"
# processor has a custom entry point
entrypoint: /recorder
command: []
volumes:
- ./config/:/config/
# video recording window
# (record to memory so we don't wear out the HD)
- /mnt/ramdisk:/mnt/ramdisk
logging:
driver: "none"
trigger:
image: stakach/ai-trigger
restart: always
# network
container_name: trigger
hostname: trigger
network_mode: "host"
# required to open GPIO chips
devices:
- "/dev/gpiochip0:/dev/gpiochip0"
# required to trigger GPIO lines
cap_add:
- SYS_RAWIO
# Not required when using host network mode
# ports:
# - "3001:3001"
logging:
driver: "none"
frontend:
image: nginx
restart: always
# has to match the other containers
network_mode: "host"
container_name: frontend
hostname: frontend
depends_on:
- interface
volumes:
- ./www/:/usr/share/nginx/html
- ./nginx.conf:/etc/nginx/conf.d/default.conf
logging:
driver: "none"
# Not required when using host network mode
# ports:
# - 5000:80
# extra_hosts:
# - "host.docker.internal:host-gateway"