Initials() capped the loop with len(out) == 2, which counts bytes: a name starting with Ä, Ö or Å filled the budget on its own and returned a single letter. Count the initials taken instead. go fix also wanted a strings.Builder here, but that allocates a string per iteration to measure a two-character result. Took its SplitSeq suggestion in lyrics.go, which drops an intermediate slice.
20 lines
871 B
Docker
20 lines
871 B
Docker
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"]
|