From 23fe5465b8a6ff35d33d749c5a059ee83f33e4f0 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Fri, 4 Oct 2024 11:17:31 +0300 Subject: [PATCH] fix: reorder dockerfile to cache templ install --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ed9e4c1..45aba39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,11 +10,12 @@ WORKDIR /usr/src/app COPY go.mod go.sum ./ RUN go mod download && go mod verify -COPY cmd/ ./cmd -COPY internal/ ./internal RUN go install github.com/a-h/templ/cmd/templ@$(go list -m -f '{{ .Version }}' github.com/a-h/templ) RUN templ generate --path internal/components +COPY cmd/ ./cmd +COPY internal/ ./internal + RUN --mount=type=cache,target=/root/.cache/go-build \ CGO_ENABLED=1 GOOS=linux go build -ldflags=-X=main.version=${VERSION} -v -o /felu ./cmd/felu/main.go -- 2.44.1