FROM golang:1.27-alpine AS build # CalVer, injected at build so no file needs bumping by hand: docker build --build-arg VERSION=… ARG VERSION=dev WORKDIR /src COPY go.mod go.sum ./ RUN go mod download COPY . . RUN CGO_ENABLED=0 go build -ldflags "-X main.version=${VERSION}" -o /levyraati . FROM alpine:3.24 # yt-dlp rots against YouTube. Alpine's active branch tracks it closely (3.24 carries the current # release), so a rebuild is the update — and this avoids python3 + pip in the image entirely. # sqlite is the CLI only — the app links its own pure-Go copy. It is here so `.backup` and a shell # are reachable with docker compose exec, which is the whole of database operations now. RUN apk add --no-cache ffmpeg yt-dlp ca-certificates sqlite COPY --from=build /levyraati /usr/local/bin/levyraati ENV STORAGE_DIR=/storage EXPOSE 8080 ENTRYPOINT ["levyraati"]