Versions are YYYY.MM.DD-N, injected with -ldflags from a git tag, so no file in the repo carries the number and a local build honestly says dev. The version shows in the footer, the startup log and /healthz. The song page's metadata was five different kinds of fact — artist, genre, duration, provenance and a badge about the viewer — in one flat run with two competing pills. Now the artist has its own line in the display face, and the facts sit in four labelled cells like the spine of a cassette insert. The submitter links to their profile, "oma kappale" became "lähetti: sinä", and the clock time is gone: nobody needs the minute a song was published.
18 lines
674 B
Docker
18 lines
674 B
Docker
FROM golang:1.26-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.
|
|
RUN apk add --no-cache ffmpeg yt-dlp ca-certificates
|
|
COPY --from=build /levyraati /usr/local/bin/levyraati
|
|
ENV STORAGE_DIR=/storage
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["levyraati"]
|