-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b37a01
commit a0feca9
Showing
1 changed file
with
16 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
# Build wallet-chain-node in a stock Go builder container | ||
FROM golang:1.19.3-alpine as builder | ||
FROM golang:1.21.1-alpine3.18 as builder | ||
|
||
RUN apk add --no-cache make gcc musl-dev linux-headers | ||
RUN apk add --no-cache make ca-certificates gcc musl-dev linux-headers git jq bash | ||
|
||
ADD . /wallet-chain-node | ||
RUN cd /wallet-chain-node && go build | ||
COPY ./go.mod /app/go.mod | ||
COPY ./go.sum /app/go.sum | ||
|
||
# Pull wallet-chain-node into a second stage deploy alpine container | ||
FROM alpine:latest | ||
WORKDIR /app | ||
|
||
RUN apk add --no-cache ca-certificates | ||
RUN mkdir /etc/wallet-chain-node | ||
RUN go mod download | ||
|
||
ARG CONFIG=config.yml | ||
# build wallet-chain-node with the shared go.mod & go.sum files | ||
COPY . /app/wallet-chain-node | ||
|
||
COPY --from=builder /wallet-chain-node /usr/local/bin/ | ||
COPY --from=builder /wallet-chain-node/${CONFIG} /etc/wallet-chain-node/config.yml | ||
WORKDIR /app/wallet-chain-node | ||
|
||
RUN make | ||
|
||
FROM alpine:3.18 | ||
|
||
COPY --from=builder /app/wallet-chain-node/wallet-chain-node /usr/local/bin | ||
COPY --from=builder /app/wallet-chain-node/config.yaml /app/wallet-chain-node/config.yaml | ||
|
||
EXPOSE 8189 | ||
ENTRYPOINT ["wallet-chain-node"] | ||
CMD ["-c", "/etc/wallet-chain-node/config.yml"] |