-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
84 lines (81 loc) · 3.75 KB
/
Copy pathcompose.yaml
File metadata and controls
84 lines (81 loc) · 3.75 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
# Docker Compose for led-ticker.
# Single image runs on both the Pi 4 sign and the Pi 5 bigsign — the rgbmatrix
# library detects the SoC at runtime and selects the right GPIO backend.
#
# Usage:
# make setup # first time: preflight + seed + build + start
# make update # rebuild image (real version) + recreate services
# make logs # tail logs
# make restart # restart after editing config
# make down # stop and remove
#
# Files (relative to this compose file's directory):
# ./config/config.toml # display + playlist config
# ./.env # API keys (WEATHERAPI_KEY etc.)
# # — also auto-loaded by compose for var interpolation
services:
led-ticker:
image: led-ticker
build:
context: .
args:
BUILD_REF: ${BUILD_REF:-}
SETUPTOOLS_SCM_PRETEND_VERSION: ${SETUPTOOLS_SCM_PRETEND_VERSION:-}
container_name: led-ticker
restart: unless-stopped
privileged: true # needed for GPIO access on the HAT
network_mode: host # outbound API calls (weather, RSS, MLB, etc.)
volumes:
- ./config:/code/config:ro
- ticker-status:/run/led-ticker # shared with webui; display process writes status.json here
- ticker-plugins:/data/plugins # installed plugins (runtime reconcile); reset = docker compose down -v && docker compose up -d (with webui: COMPOSE_PROFILES=webui docker compose down -v && COMPOSE_PROFILES=webui docker compose up -d)
env_file:
- path: ./.env
required: false # repo may not have .env if no API keys are needed
# Web status UI — unprivileged sidecar, same image. Reads the status.json
# the display process publishes; serves http://<pi>:8080.
# Opt-in via compose profile so a plain `docker compose up -d` changes
# nothing (without a [web] block the subcommand exits, and unless-stopped
# would restart-loop it). Enable with BOTH:
# 1. a [web] block in config.toml (see config.example.toml)
# 2. COMPOSE_PROFILES=webui docker compose up -d (or --profile webui)
webui:
profiles: ["webui"]
image: led-ticker
build:
context: .
args:
BUILD_REF: ${BUILD_REF:-}
SETUPTOOLS_SCM_PRETEND_VERSION: ${SETUPTOOLS_SCM_PRETEND_VERSION:-}
container_name: led-ticker-webui
restart: unless-stopped
command: ["led-ticker", "webui", "--config", "/code/config/config.toml"]
network_mode: host
volumes:
# rw so the web config editor can write config.toml; the display still mounts :ro and hot-reloads the change.
- ./config:/code/config:rw
- ticker-status:/run/led-ticker
# :ro for plugin VISIBILITY only — the webui's config validator must SEE
# plugin widget types (else false "plugin not loaded" warnings). It never
# installs; only the display service mounts this :rw and reconciles.
- ticker-plugins:/data/plugins:ro
env_file:
# The webui resolves its auth token from the environment, same as the
# display service — LED_TICKER_WEB_TOKEN (config editor + plugin Store)
# and LED_TICKER_BUSY_TOKEN. Without this the sidecar sees no token and
# reports "editing disabled" even when the token is set in .env.
- path: ./.env
required: false
volumes:
# tmpfs-backed: status.json is rewritten ~every 2s. Keeping it in RAM
# avoids SD-card wear (~43K small writes/day) and the SD write-latency
# tail (measured on a Pi 5 SD card: p99 ~4ms, max ~16ms of the 50ms
# render tick; tmpfs is sub-ms). Size-capped — it only ever holds one
# small JSON snapshot.
ticker-status:
driver: local
driver_opts:
type: tmpfs
device: tmpfs
o: size=1m
ticker-plugins: