fix prefs, move to go tool, refine docs and etc

This commit is contained in:
Laptop
2025-09-05 19:26:38 +03:00
parent 0cf9f0d53f
commit c1adaee889
11 changed files with 127 additions and 122 deletions

View File

@@ -1,4 +1,4 @@
ARG GO_VERSION=1.25.0
ARG GO_VERSION=1.25.1
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION} AS build
ARG TARGETOS
@@ -14,19 +14,15 @@ RUN go env -w GOPROXY=direct && \
echo "soundcloak:x:5000:" > /etc2/group
COPY go.* .
RUN go mod download -x && \
go install -v github.com/a-h/templ/cmd/templ@latest && \
go install -v github.com/dlclark/regexp2cg@main
RUN go mod download -x
COPY . .
# usually soundcloakctl updates together with soundcloak, so we should redownload it
RUN go install -v git.maid.zone/stuff/soundcloakctl@master && \
soundcloakctl js download && \
templ generate && \
RUN go tool soundcloakctl js download && \
go tool templ generate && \
go generate ./lib/* && \
soundcloakctl config codegen && \
soundcloakctl -nozstd precompress && \
CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=${TARGETOS} go build -v -ldflags "-s -w -extldflags '-static' -X git.maid.zone/stuff/soundcloak/lib/cfg.Commit=`git rev-parse HEAD | head -c 7` -X git.maid.zone/stuff/soundcloak/lib/cfg.Repo=`git remote get-url origin`" -o ./app && \
soundcloakctl postbuild
go tool soundcloakctl config codegen && \
go tool soundcloakctl -nozstd precompress && \
CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=${TARGETOS} go build -v -ldflags "-s -w -extldflags '-static' -X git.maid.zone/stuff/soundcloak/lib/cfg.Commit=`git rev-parse --short HEAD` -X git.maid.zone/stuff/soundcloak/lib/cfg.Repo=`git remote get-url origin`" -o ./app && \
go tool soundcloakctl postbuild
FROM scratch