From b30ba43dcf6aff8a5fb1ae5e131bd1ab7bb2fb43 Mon Sep 17 00:00:00 2001 From: garrettladley Date: Tue, 11 Jun 2024 17:22:27 -0400 Subject: [PATCH] working on my machine --- backend/Dockerfile.server | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/Dockerfile.server b/backend/Dockerfile.server index e36bd02b..9050bb44 100644 --- a/backend/Dockerfile.server +++ b/backend/Dockerfile.server @@ -1,17 +1,17 @@ FROM golang:1.22-alpine as builder WORKDIR /app -RUN apk add --no-cache git -COPY . ./ -RUN go install github.com/a-h/templ/cmd/templ@latest -RUN templ generate -RUN go mod tidy +COPY . . + RUN go mod download -RUN go build -tags prod -o bin/sac main.go -FROM scratch +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/bin/sac /sac EXPOSE 8080 -ENTRYPOINT [ "/sac" ] + +ENTRYPOINT [ "/sac" ] \ No newline at end of file