From 26dd353985a99f6af3559dc53f4eda7645fa0a12 Mon Sep 17 00:00:00 2001 From: Laptop Date: Sun, 29 Dec 2024 13:33:40 +0200 Subject: [PATCH] Optimize dockerfile for EmbedFiles option --- Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index f6b6d67..ded6aa8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,10 @@ ARG TARGETARCH WORKDIR /build COPY . . + +# fuck google +RUN go env -w GOPROXY=direct + RUN go install github.com/a-h/templ/cmd/templ@latest RUN templ generate @@ -21,12 +25,14 @@ RUN CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=${TARGETOS} go build -ldflags "-s -w RUN echo "soundcloak:x:5000:5000:Soundcloak user:/:/sbin/nologin" > /etc/minimal-passwd && \ echo "soundcloak:x:5000:" > /etc/minimal-group +RUN soundcloakctl postbuild + FROM scratch COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=build /build/assets /assets -COPY --from=build /build/instance /instance -COPY --from=build /build/external /external +COPY --from=build /build/static/assets /static/assets +COPY --from=build /build/static/instance /static/instance +COPY --from=build /build/static/external /static/external COPY --from=build /build/app /app COPY --from=build /etc/minimal-passwd /etc/passwd COPY --from=build /etc/minimal-group /etc/group