add workflow to build

This commit is contained in:
roman.nikolsky
2026-07-04 01:56:10 +03:00
commit af098e6ec4
14 changed files with 1701 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
# Stage 1: Build Go binary
FROM golang:1.26-alpine AS builder
RUN apk add --no-cache git ca-certificates
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ytdlp-navidrome .
# Stage 2: Install yt-dlp and ffmpeg
FROM alpine:latest AS tools
RUN apk add --no-cache \
python3 \
py3-pip \
ffmpeg \
ca-certificates
RUN pip3 install --break-system-packages yt-dlp
# Stage 3: Final image
FROM alpine:latest
RUN apk add --no-cache \
ca-certificates \
ffmpeg \
python3 \
libc6-compat
# Copy Python + packages from tools stage
COPY --from=tools /usr/lib/python3.12 /usr/lib/python3.12
COPY --from=tools /usr/bin/yt-dlp /usr/bin/yt-dlp
COPY --from=tools /usr/bin/ffmpeg /usr/bin/ffmpeg
COPY --from=tools /usr/bin/ffprobe /usr/bin/ffprobe
# Copy Go binary
COPY --from=builder /build/ytdlp-navidrome /usr/local/bin/ytdlp-navidrome
# Create directories
RUN mkdir -p /music/ytdlp /tmp/ytdlp-previews
ENTRYPOINT ["/usr/local/bin/ytdlp-navidrome"]