From 862d4f409b5ae9a70ea99dcccaf2ebab9768dc3a Mon Sep 17 00:00:00 2001 From: Garrett Ladley <92384606+garrettladley@users.noreply.github.com> Date: Tue, 18 Jun 2024 20:12:19 -0400 Subject: [PATCH] update Dockerfile.server --- backend/Dockerfile.server | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/backend/Dockerfile.server b/backend/Dockerfile.server index 129823c6..2d8194e3 100644 --- a/backend/Dockerfile.server +++ b/backend/Dockerfile.server @@ -1,22 +1,21 @@ -# syntax=docker/dockerfile:1 - -FROM golang:1.22.2 as builder +FROM golang:1.22-alpine as builder WORKDIR /app -COPY go.mod go.sum ./ - COPY . . RUN go install github.com/a-h/templ/cmd/templ@latest + RUN templ generate -RUN CGO_ENABLED=0 GOOS=linux go build -v -o ./sac +RUN go mod download + +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o bin/sac main.go FROM alpine:latest as release -COPY --from=builder /app/sac /sac +COPY --from=builder /app/bin/sac /sac EXPOSE 8080 -ENTRYPOINT [ "/sac" ] \ No newline at end of file +ENTRYPOINT [ "/sac" ]