-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.try
More file actions
52 lines (52 loc) · 2.71 KB
/
Copy pathDockerfile.try
File metadata and controls
52 lines (52 loc) · 2.71 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
# Slim no-hardware "try it on your computer" image.
#
# Runs led-ticker fully headless with the built-in headless backend — no
# rgbmatrix C library compile, no Raspberry Pi hardware required. The webui
# preview (http://localhost:8080) lets you watch the sign render live in a
# browser.
#
# NOT for hardware deployment. For production use the main Dockerfile, which
# compiles rpi-rgb-led-matrix and targets a Raspberry Pi.
#
# Pattern: mirrors plugins/telnet/Dockerfile.smoke in the led-ticker-plugins
# monorepo, but installs from source and uses core's headless backend + webui
# instead of a telnet backend.
#
# Build:
# docker build -f Dockerfile.try -t led-ticker-try .
# Run (publish the webui port):
# docker run -d --name led-try -p 8080:8080 led-ticker-try
# open http://localhost:8080
# Stop:
# docker rm -f led-try
#
# Or via compose: make try (see compose.try.yaml)
FROM python:3.14-bookworm
WORKDIR /code
COPY pyproject.toml README.md ./
COPY src ./src
# Install core from source, then snapshot its transitive dependency versions as
# constraints so the plugin install below can't move a version core locked.
# led-ticker-core itself is EXCLUDED from those constraints: the source build
# versions as 0.0.0 (no .git SCM tag in the Docker build context) and the plugins
# require `led-ticker-core>=2.x`, so pip resolves that from PyPI — the try image
# runs the latest matching PyPI RELEASE of core, plus the source's bundled config.
# That's intentional for an evaluation try (you see the released code). To preview
# uncommitted local core changes, use `make dev` and run led-ticker directly.
# NOTE: the production Dockerfile's "fail if core==0.0.0" guard is intentionally
# absent here — the try image is SUPPOSED to build core at 0.0.0 and pull the
# released core from PyPI. Do not copy that guard into this file.
RUN pip install --no-cache-dir . \
&& pip list --format=freeze | grep -v '^led-ticker-core==' > /code/constraints-core.txt
# Install curated keyless plugins for the try-it showcase.
# COPY is its own layer so editing requirements-plugins.try.txt busts exactly
# this layer on the next `make try` (--build), without re-installing core.
COPY config/requirements-plugins.try.txt ./config/requirements-plugins.try.txt
RUN pip install --no-cache-dir -c /code/constraints-core.txt -r config/requirements-plugins.try.txt
# Bake the committed try config (so a bare `docker run` with no mount works).
# compose's `try` profile mounts ./config and runs against the same committed
# file, so a fresh clone needs no config/config.toml (which is gitignored).
COPY config/config.try.example.toml /code/config/config.try.example.toml
ENV PYTHONUNBUFFERED=1
EXPOSE 8080
CMD ["led-ticker", "--config", "/code/config/config.try.example.toml"]