-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
64 lines (62 loc) · 2.22 KB
/
Copy pathdocker-compose.yml
File metadata and controls
64 lines (62 loc) · 2.22 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
# 24/7 stack.
#
# cp .env.example .env # then put the real camera URL in it
# docker compose up -d --build # OCR scheduler (RTSP -> Kafka)
#
# The dummy service publishes INVENTED readings and is behind a profile so it
# can never start by accident. Use it only to exercise a consumer with no
# camera present:
# docker compose --profile dummy up -d dummy-publisher
#
# restart: unless-stopped means Docker restarts these on daemon start and after
# a reboot - provided Docker itself is set to start on login. It does NOT mean
# they run while the machine is powered off; nothing local can.
services:
meter-ocr:
build:
context: .
dockerfile: Dockerfile.v5
image: meter-ocr:v5
container_name: meter-ocr
restart: unless-stopped
# schedule = capture every enabled camera on the configured interval,
# forever. run_on_start takes the first reading immediately.
command: ["schedule"]
# Camera credentials live here, never in the committed config.yaml.
# Copy .env.example to .env before the first run.
env_file:
- .env
environment:
TZ: "Asia/Kolkata"
volumes:
# Mounted, not baked: the config comments promise a change takes effect
# on `docker restart` with no rebuild, and that only holds if the file
# comes from the host.
- ./config.yaml:/app/config.yaml:ro
- ./data:/app/data
- ./logs:/app/logs
- ./images:/app/images
# OCR of a frame can outlast the default 10s SIGKILL grace period.
stop_grace_period: 30s
logging:
driver: "json-file"
options: { max-size: "10m", max-file: "5" }
# Synthetic hourly feed. Opt-in: it puts invented readings on the same topic
# as the real ones, so it must never start by accident alongside the real
# pipeline. Start it only with --profile dummy.
dummy-publisher:
build:
context: .
dockerfile: Dockerfile.dummy
image: meter-dummy:1
container_name: meter-dummy-publisher
restart: unless-stopped
profiles: ["dummy"]
environment:
TZ: "Asia/Kolkata"
PERIOD_SECONDS: "3600"
volumes:
- ./config.yaml:/app/config.yaml:ro
logging:
driver: "json-file"
options: { max-size: "10m", max-file: "5" }