32 lines
651 B
Docker
32 lines
651 B
Docker
# 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: Final image
|
|
FROM alpine:latest
|
|
|
|
RUN apk add --no-cache \
|
|
ca-certificates \
|
|
ffmpeg \
|
|
python3 \
|
|
py3-pip \
|
|
libc6-compat
|
|
|
|
RUN pip3 install --break-system-packages yt-dlp
|
|
|
|
# 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"]
|