mirror of
https://git.maid.zone/stuff/soundcloak.git
synced 2026-03-22 08:38:11 +05:00
fix prefs, move to go tool, refine docs and etc
This commit is contained in:
20
Dockerfile
20
Dockerfile
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user