Skip to content

Commit

Permalink
update Dockerfile.server
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley authored Jun 19, 2024
1 parent 8fcd51c commit 862d4f4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions backend/Dockerfile.server
Original file line number Diff line number Diff line change
@@ -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" ]
ENTRYPOINT [ "/sac" ]

0 comments on commit 862d4f4

Please sign in to comment.