Skip to content

Commit

Permalink
refine backend Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Grvzard committed Sep 4, 2024
1 parent f36e42e commit 66f4748
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
FROM golang:latest
ENV GIN_MODE release
FROM golang:1.21 as build

WORKDIR /app

COPY . .
RUN go build -o backend main.go

ENV GIN_MODE release

RUN go mod download
RUN CGO_ENABLED=0 go build -o server


FROM gcr.io/distroless/static-debian12

COPY --from=build /app/server /
EXPOSE 8080
ENTRYPOINT ["./backend"]
ENTRYPOINT ["/server"]

0 comments on commit 66f4748

Please sign in to comment.