Skip to content

Commit

Permalink
API Dockerfile review
Browse files Browse the repository at this point in the history
  • Loading branch information
evmos-lde committed Oct 13, 2023
1 parent c463a8a commit c6bc698
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
FROM golang:1.21.1-bullseye
FROM golang:1.21.1 as builder

WORKDIR /go/src/

COPY . .
RUN go build ./cmd/server/
EXPOSE 8081

RUN CGO_ENABLED=1 GOOS=linux go build -o ./server --ldflags '-w -s -extldflags "-static"' ./cmd/server/

FROM scratch as runner

WORKDIR /app

COPY --from=builder /go/src/server .
COPY --from=builder /go/src/api/config/config.toml ./api/config/config.toml
EXPOSE 8081
CMD ["./server"]

0 comments on commit c6bc698

Please sign in to comment.