Skip to content

Commit

Permalink
fix docker file (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 authored Oct 9, 2024
1 parent bb2a638 commit ced1fbe
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
36 changes: 25 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
FROM golang:1.22-bullseye AS go-builder
# Stage 1: Build the Go project
FROM golang:1.22-alpine3.19 AS go-builder

# Install minimum necessary dependencies, build Cosmos SDK, remove packages
RUN apt update
RUN apt install -y curl git build-essential ca-certificates
# debug: for live editting in the image
RUN apt install -y vim
# Use build arguments for the target architecture
ARG TARGETARCH
ARG GOARCH

# Install necessary packages
RUN set -eux; apk add --no-cache ca-certificates build-base git cmake

WORKDIR /code
COPY . /code/

RUN LEDGER_ENABLED=false make build
# Install mimalloc
RUN git clone --depth 1 https://github.com/microsoft/mimalloc; cd mimalloc; mkdir build; cd build; cmake ..; make -j$(nproc); make install
ENV MIMALLOC_RESERVE_HUGE_OS_PAGES=4

RUN LEDGER_ENABLED=false GOARCH=${GOARCH} LDFLAGS="-linkmode=external -extldflags \"-L/code/mimalloc/build -lmimalloc -Wl,-z,muldefs -static\"" make build

FROM alpine:3.19

RUN addgroup minitia \
&& adduser -G minitia -D -h /minitia minitia

FROM ubuntu:20.04
WORKDIR /minitia

WORKDIR /root
COPY --from=go-builder /code/build/minitiad /usr/local/bin/minitiad

COPY --from=go-builder /etc/ssl/certs /etc/ssl/certs
COPY --from=go-builder /code/build/minitiad /usr/local/bin/minitiad
USER minitia

# rest server
EXPOSE 1317
Expand All @@ -26,5 +36,9 @@ EXPOSE 9090
EXPOSE 26656
# tendermint rpc
EXPOSE 26657
# geth jsonrpc
EXPOSE 8545
# geth jsonrpc ws
EXPOSE 8546

CMD ["/usr/local/bin/minitiad", "version"]
3 changes: 3 additions & 0 deletions cmd/minitiad/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ func initAppConfig() (string, interface{}) {
JSONRPCConfig: jsonrpcconfig.DefaultJSONRPCConfig(),
}

minitiaAppConfig.JSONRPCConfig.Address = "0.0.0.0:8545"
minitiaAppConfig.JSONRPCConfig.AddressWS = "0.0.0.0:8546"

minitiaAppTemplate := serverconfig.DefaultConfigTemplate +
evmconfig.DefaultConfigTemplate +
indexerconfig.DefaultConfigTemplate +
Expand Down

0 comments on commit ced1fbe

Please sign in to comment.