Opt-in WITH_FFMPEG build arg installs Debian's ffmpeg in the backend image
Off by default, since it adds about 400 MB. Documented with the clip recipe and in the configuration reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
@@ -26,6 +26,16 @@ ENV PATH="/app/.venv/bin:$PATH"
|
|||||||
# environment somebody already works in is the case that adopts instead.
|
# environment somebody already works in is the case that adopts instead.
|
||||||
ENV NODE_VENV=managed
|
ENV NODE_VENV=managed
|
||||||
|
|
||||||
|
# ffmpeg for node code that transcodes, such as the clip recipe in
|
||||||
|
# docs/code/nodes.md. Off by default: Debian's package and what it pulls in add
|
||||||
|
# about 400 MB. Set WITH_FFMPEG=true in .env and rebuild to include it.
|
||||||
|
ARG WITH_FFMPEG=false
|
||||||
|
RUN if [ "$WITH_FFMPEG" = true ]; then \
|
||||||
|
apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends ffmpeg \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*; \
|
||||||
|
fi
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
|
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
|
||||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
|
|||||||
@@ -163,6 +163,9 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: backend/Dockerfile
|
dockerfile: backend/Dockerfile
|
||||||
|
args:
|
||||||
|
# Opt-in: ffmpeg costs the image about 400 MB (backend/Dockerfile).
|
||||||
|
- WITH_FFMPEG=${WITH_FFMPEG:-false}
|
||||||
labels:
|
labels:
|
||||||
- autoheal=true
|
- autoheal=true
|
||||||
- traefik.enable=true
|
- traefik.enable=true
|
||||||
|
|||||||
+4
-3
@@ -150,9 +150,10 @@ def process(clip):
|
|||||||
```
|
```
|
||||||
|
|
||||||
Use it only for clips headed for such a panel. Browsers play the originals,
|
Use it only for clips headed for such a panel. Browsers play the originals,
|
||||||
and the result plays there too, just smaller. The Docker image does not ship
|
and the result plays there too, just smaller. The node needs `ffmpeg` on the
|
||||||
`ffmpeg` yet, so the node runs only where `ffmpeg` is on the `PATH`, such as a
|
`PATH`. The Docker image includes it only when built with
|
||||||
[remote worker](workers.md).
|
[`WITH_FFMPEG=true`](../reference/configuration.md#image-options) in `.env`.
|
||||||
|
Otherwise run the node on a [remote worker](workers.md) that has it.
|
||||||
|
|
||||||
## Printing
|
## Printing
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,12 @@ to the backend. An empty value needs that proxy when the frontend and backend
|
|||||||
are served separately. See [facility automation](../getting-started/facility-automation.md#run-it-long-term)
|
are served separately. See [facility automation](../getting-started/facility-automation.md#run-it-long-term)
|
||||||
for deployment settings.
|
for deployment settings.
|
||||||
|
|
||||||
|
## Image options
|
||||||
|
|
||||||
|
`WITH_FFMPEG=true` in `.env` installs `ffmpeg` into the backend image on the
|
||||||
|
next build, for node code that transcodes video. It is off by default because
|
||||||
|
it adds about 400 MB.
|
||||||
|
|
||||||
## Environment
|
## Environment
|
||||||
|
|
||||||
| Variable | Default | Purpose |
|
| Variable | Default | Purpose |
|
||||||
|
|||||||
Reference in New Issue
Block a user