-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
257 lines (242 loc) · 6.68 KB
/
docker-compose.yaml
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
volumes:
postgres:
media:
services:
postgres:
# this obscure image is chosen because it has x86_64 and arm64 support
image: duvel/postgis:15-3.3
restart: unless-stopped
stop_grace_period: 0s
healthcheck:
interval: 5s
timeout: 4s
start_period: 60s
test: ["CMD", "pg_isready", "-h", "localhost", "-U", "postgres"]
volumes:
- postgres:/home/postgres/pgdata/data
environment:
- "POSTGRES_DB=camry"
- "POSTGRES_PASSWORD=NoNVR!11"
ports:
- 5432:5432/tcp
migrate:
depends_on:
postgres:
condition: service_healthy
image: migrate/migrate:v4.17.1
restart: no
stop_grace_period: 0s
volumes:
- ./database/migrations:/migrations
command: >
--source file:///migrations
--database postgres://postgres:NoNVR!11@postgres:5432/camry?sslmode=disable
up
post-migrate:
depends_on:
migrate:
condition: service_completed_successfully
# this obscure image is chosen because it has x86_64 and arm64 support
image: duvel/postgis:15-3.3
restart: no
stop_grace_period: 0s
entrypoint: ["/bin/bash", "-c"]
command: "PAGER=cat PGPASSWORD=NoNVR!11 psql -h postgres -p 5432 -U postgres -a camry -c 'VACUUM FULL; VACUUM ANALYZE;'"
redis:
image: redis:7.2.5
restart: unless-stopped
stop_grace_period: 0s
ports:
- 6379:6379/tcp
swagger:
restart: unless-stopped
stop_grace_period: 0s
image: swaggerapi/swagger-ui:v5.4.2
environment:
- "BASE_URL=/"
- "SWAGGER_JSON_URL=http://0.0.0.0:7070/api/openapi.json"
ports:
- "7071:8080/tcp"
nats:
restart: unless-stopped
stop_grace_period: 0s
image: nats:2.10.18
ports:
- "4222:4222/tcp"
command: ["-js"]
api:
profiles:
- full
depends_on:
post-migrate:
condition: service_completed_successfully
restart: unless-stopped
stop_grace_period: 0s
build:
dockerfile: ./docker/api/Dockerfile
context: .
environment:
- "DJANGOLANG_NODE_NAME=api"
- "POSTGRES_HOST=postgres"
- "POSTGRES_PASSWORD=NoNVR!11"
- "POSTGRES_DB=camry"
- "REDIS_URL=redis://redis:6379"
- "DJANGOLANG_PROFILE=${DJANGOLANG_PROFILE:-0}"
ports:
- 7070:7070/tcp
command:
- serve
frontend:
profiles:
- full
depends_on:
post-migrate:
condition: service_completed_successfully
restart: unless-stopped
stop_grace_period: 0s
build:
dockerfile: ./docker/frontend/Dockerfile
context: .
volumes:
- media:/srv/media
ports:
- 3000:80/tcp
bootstrap:
profiles:
- full
depends_on:
api:
condition: service_healthy
image: curlimages/curl
restart: on-failure
command:
- sh
- -c
- |
curl -vvv -X POST http://api:7070/api/cameras -d '[{"name": "Driveway", "stream_url": "rtsp://192.168.137.31:554/Streaming/Channels/101"}, {"name": "Front door", "stream_url": "rtsp://192.168.137.32:554/Streaming/Channels/101"}, {"name": "Side gate", "stream_url": "rtsp://192.168.137.33:554/Streaming/Channels/101"}]'
segment-producer-driveway:
profiles:
- full
depends_on:
bootstrap:
condition: service_completed_successfully
restart: unless-stopped
stop_grace_period: 0s
build:
dockerfile: ./docker/segment-producer/Dockerfile
context: .
volumes:
- media:/srv/media
environment:
- "POSTGRES_HOST=postgres"
- "POSTGRES_PASSWORD=NoNVR!11"
- "POSTGRES_DB=camry"
- "NET_CAM_URL=rtsp://192.168.137.31:554/Streaming/Channels/101"
- "CAMERA_NAME=Driveway"
segment-producer-front-door:
profiles:
- full
depends_on:
bootstrap:
condition: service_completed_successfully
restart: unless-stopped
stop_grace_period: 0s
build:
dockerfile: ./docker/segment-producer/Dockerfile
context: .
volumes:
- media:/srv/media
environment:
- "POSTGRES_HOST=postgres"
- "POSTGRES_PASSWORD=NoNVR!11"
- "POSTGRES_DB=camry"
- "NET_CAM_URL=rtsp://192.168.137.32:554/Streaming/Channels/101"
- "CAMERA_NAME=Front door"
segment-producer-side-gate:
profiles:
- full
depends_on:
bootstrap:
condition: service_completed_successfully
restart: unless-stopped
stop_grace_period: 0s
build:
dockerfile: ./docker/segment-producer/Dockerfile
context: .
volumes:
- media:/srv/media
environment:
- "POSTGRES_HOST=postgres"
- "POSTGRES_PASSWORD=NoNVR!11"
- "POSTGRES_DB=camry"
- "NET_CAM_URL=rtsp://192.168.137.33:554/Streaming/Channels/101"
- "CAMERA_NAME=Side gate"
object-detector-driveway:
profiles:
- full
depends_on:
bootstrap:
condition: service_completed_successfully
restart: unless-stopped
stop_grace_period: 0s
build:
dockerfile: ./docker/object-detector/Dockerfile
context: .
args:
- "BASE_IMAGE=pytorch/pytorch:2.4.0-cuda11.8-cudnn9-runtime"
volumes:
- media:/srv/media
environment:
- "POSTGRES_HOST=postgres"
- "POSTGRES_PASSWORD=NoNVR!11"
- "POSTGRES_DB=camry"
- "NET_CAM_URL=rtsp://192.168.137.31:554/Streaming/Channels/101"
- "CAMERA_NAME=Driveway"
- "API_URL=http://api:7070"
- "CUDA_VISIBLE_DEVICES="
object-detector-front-door:
profiles:
- full
depends_on:
bootstrap:
condition: service_completed_successfully
restart: unless-stopped
stop_grace_period: 0s
build:
dockerfile: ./docker/object-detector/Dockerfile
context: .
args:
- "BASE_IMAGE=pytorch/pytorch:2.4.0-cuda11.8-cudnn9-runtime"
volumes:
- media:/srv/media
environment:
- "POSTGRES_HOST=postgres"
- "POSTGRES_PASSWORD=NoNVR!11"
- "POSTGRES_DB=camry"
- "NET_CAM_URL=rtsp://192.168.137.32:554/Streaming/Channels/101"
- "CAMERA_NAME=Front door"
- "API_URL=http://api:7070"
- "CUDA_VISIBLE_DEVICES="
object-detector-side-gate:
profiles:
- full
depends_on:
bootstrap:
condition: service_completed_successfully
restart: unless-stopped
stop_grace_period: 0s
build:
dockerfile: ./docker/object-detector/Dockerfile
context: .
args:
- "BASE_IMAGE=pytorch/pytorch:2.4.0-cuda11.8-cudnn9-runtime"
volumes:
- media:/srv/media
environment:
- "POSTGRES_HOST=postgres"
- "POSTGRES_PASSWORD=NoNVR!11"
- "POSTGRES_DB=camry"
- "NET_CAM_URL=rtsp://192.168.137.33:554/Streaming/Channels/101"
- "CAMERA_NAME=Side gate"
- "API_URL=http://api:7070"
- "CUDA_VISIBLE_DEVICES="