-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add Dockerfile for seda-chain
- Loading branch information
1 parent
db73ffb
commit a3c4930
Showing
1 changed file
with
35 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM golang:1.21-alpine AS build-env | ||
|
||
# Install minimum necessary dependencies | ||
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev | ||
RUN apk add --no-cache $PACKAGES | ||
|
||
|
||
WORKDIR /go/src/github.com/sedaprotocol/seda-chain | ||
|
||
# Optimized fetching of dependencies | ||
COPY go.mod go.sum ./ | ||
|
||
RUN go mod download | ||
|
||
# Copy and build the project | ||
COPY . . | ||
|
||
# Dockerfile Cross-Compilation Guide | ||
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide | ||
ARG TARGETOS TARGETARCH | ||
|
||
|
||
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build | ||
|
||
|
||
FROM alpine:3 | ||
|
||
RUN apk add --no-cache curl make bash jq sed | ||
COPY --from=build-env /go/src/github.com/cosmos/cosmos-sdk/build/seda-chaid /usr/bin/seda-chaind | ||
|
||
EXPOSE 26656 26657 1317 9090 | ||
|
||
CMD ["seda-chaind", "start"] | ||
STOPSIGNAL SIGTERM | ||
WORKDIR /root |