From 70776141164c7a92328bbe3c1182c02b2d19839c Mon Sep 17 00:00:00 2001 From: bvandeusen Date: Sat, 18 Apr 2026 21:20:54 +0000 Subject: [PATCH] feat(skel): multi-stage Dockerfile for minstrel runtime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builder uses golang:1.23-bookworm (matches runner-base:go-ci). Runtime is debian:bookworm-slim with ffmpeg (server spec ยง3) plus a non-root minstrel user. Release workflow builds from this Dockerfile. --- Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..ed61cdc7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# syntax=docker/dockerfile:1.6 + +FROM golang:1.23-bookworm AS builder +WORKDIR /src +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +ENV CGO_ENABLED=0 +RUN go build -trimpath -ldflags="-s -w" -o /out/minstrel ./cmd/minstrel + +FROM debian:bookworm-slim +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates ffmpeg \ + && rm -rf /var/lib/apt/lists/* + +RUN groupadd --system --gid 1000 minstrel \ + && useradd --system --uid 1000 --gid minstrel --shell /usr/sbin/nologin minstrel + +COPY --from=builder /out/minstrel /usr/local/bin/minstrel +COPY config.example.yaml /etc/smartmusic/config.yaml + +USER minstrel +EXPOSE 4533 +ENTRYPOINT ["/usr/local/bin/minstrel"] +CMD ["--config", "/etc/smartmusic/config.yaml"]