sheepflix/Dockerfile.transcode

35 lines
983 B
Text
Raw Normal View History

2026-08-26 01:24:51 -04:00
FROM golang:1.23-alpine AS builder
ARG GO_TRANSCODE_COMMIT=f8137e68c7b8da88c51aec9563eec9585c10c723
WORKDIR /src
RUN apk add --no-cache git
RUN git clone https://github.com/m1k1o/go-transcode.git . \
&& git checkout "$GO_TRANSCODE_COMMIT"
COPY patches/go-transcode-vaapi.patch /tmp/go-transcode-vaapi.patch
RUN git apply /tmp/go-transcode-vaapi.patch \
&& CGO_ENABLED=0 go build -o /go-transcode .
# Keep Alpine 3.17: upstream documents an FFmpeg 6 segmenting regression with
# newer Alpine releases. Install both Intel and Mesa VAAPI drivers so this also
# works if the Unraid host exposes an AMD render device.
FROM alpine:3.17
WORKDIR /app
2026-08-26 01:27:02 -04:00
RUN apk add --no-cache \
2026-08-26 01:24:51 -04:00
bash \
ffmpeg \
intel-media-driver \
libva-intel-driver \
mesa-va-gallium
COPY --from=builder /go-transcode /app/go-transcode
EXPOSE 8080
ENV TRANSCODE_BIND=:8080 \
TRANSCODE_VAAPI_DEVICE=/dev/dri/renderD128
ENTRYPOINT ["/app/go-transcode"]
CMD ["serve"]