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 24, 2023
1 parent 97f6e57 commit 6812310
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
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 alpine:3.17 as alpine

RUN apk add -U --no-cache ca-certificates

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
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
EXPOSE 8081
CMD ["./server"]

0 comments on commit 6812310

Please sign in to comment.