Skip to content

Commit

Permalink
fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-brennan2005 committed Jun 11, 2024
1 parent 1bebe61 commit 29f6c6f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/Dockerfile.server
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# syntax=docker/dockerfile:1
FROM golang:1.22-alpine as builder

WORKDIR /app
Expand All @@ -9,7 +10,10 @@ RUN templ generate
RUN go get ./...
RUN go mod tidy
RUN go mod download
RUN go build -tags prod -o bin/sac main.go

# Build the Go binary (optimized for production)
RUN mkdir -p /app/bin
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /app/bin/sac

FROM scratch
COPY --from=builder /app/bin/sac /sac
Expand Down

0 comments on commit 29f6c6f

Please sign in to comment.