From ef52d7856cfca0d19a1750b9665d2d07e9daecca Mon Sep 17 00:00:00 2001 From: Esa Kataja Date: Sun, 21 Jun 2026 17:08:32 +0300 Subject: [PATCH] add: Docker image and compose for containerized deploy Multi-stage build (cgo for the SQLite logger) on debian-slim with ffmpeg, opus-tools, and ca-certificates bundled. Compose mounts ./data/config.yaml and ./data/media; SIGTERM cancels in-flight encodes cleanly. --- .dockerignore | 14 ++++++++++++++ Dockerfile | 17 +++++++++++++++++ docker-compose.yml | 10 ++++++++++ 3 files changed, 41 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f9cb8a0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,14 @@ +videnc-vibe +*.mkv +*.wav +*.opus +*.log +logs.db +*.json +/input +/output +/originals +/failed +/work +.git +MANUAL.html diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..da2cfe7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# Build needs cgo (the logger uses github.com/mattn/go-sqlite3), so no scratch/static image. +FROM golang:1.26-bookworm AS build +WORKDIR /src +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN CGO_ENABLED=1 go build -ldflags="-s -w" -o /videnc-vibe ./cmd/videnc/ + +FROM debian:bookworm-slim +# ffmpeg gives ffmpeg+ffprobe; opus-tools gives opusenc; ca-certificates for OMDb/TVmaze HTTPS. +RUN apt-get update && apt-get install -y --no-install-recommends \ + ffmpeg opus-tools ca-certificates \ + && rm -rf /var/lib/apt/lists/* +COPY --from=build /videnc-vibe /usr/local/bin/videnc-vibe +# logs.db + log files land in the working dir — make it the mounted /data so they persist. +WORKDIR /data +ENTRYPOINT ["videnc-vibe", "-c", "/config/config.yaml"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..340cfec --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +services: + videnc: + build: . + container_name: videnc-vibe + restart: unless-stopped + volumes: + - ./data/config.yaml:/config/config.yaml:ro # your config — paths inside must point at /data/* + - ./data/media:/data # holds input/ output/ originals/ failed/ work/ + logs + # Uncomment to delete originals after a successful encode (appends -d to the entrypoint): + # command: ["-d"]