diff --git a/docker-compose.yml b/docker-compose.yml index a040e08..d6c49e4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,11 +7,13 @@ services: args: UPSTREAM_VERSION: v2021.07.04 ports: - - "30303" - - 30303/udp + - "30303:30303/tcp" + - "30303:30303/udp" + - "30304:30304/tcp" + - "30304:30304/udp" restart: unless-stopped volumes: - - "data:/var/lib" + - "data:/var/lib/erigon" environment: ERIGON_EXTRA_OPTS: "" rpcdaemon: @@ -23,5 +25,8 @@ services: environment: RPCDAEMON_EXTRA_OPTS: "--http.api=eth,debug,net,web3" restart: unless-stopped + volumes: + - "rpc:/var/lib/erigon" volumes: data: {} + rpc: {} diff --git a/erigon/Dockerfile b/erigon/Dockerfile index b88e995..2430a2a 100644 --- a/erigon/Dockerfile +++ b/erigon/Dockerfile @@ -1,33 +1,15 @@ -FROM golang:1.16-alpine3.13 as builder +ARG UPSTREAM_VERSION -ARG git_commit -ENV GIT_COMMIT=$git_commit +FROM thorax/erigon:${UPSTREAM_VERSION} -ARG git_branch -ENV GIT_BRANCH=$git_branch - -# for linters to avoid warnings. we won't use linters in Docker anyway -ENV LATEST_COMMIT="undefined" - -ARG UPSTREAM_VERSION - -RUN apk --no-cache add make gcc g++ linux-headers git bash ca-certificates libgcc libstdc++ - -WORKDIR /app - -RUN git clone -b ${UPSTREAM_VERSION} --recurse-submodules -j8 https://github.com/ledgerwatch/erigon.git /app -RUN go mod download -RUN make all - -FROM alpine:3.13 - -RUN apk add --no-cache ca-certificates libgcc libstdc++ tzdata - -COPY --from=builder /app/build/bin/* /usr/local/bin/ - -ENTRYPOINT [ "sh", "-c", "exec erigon \ +ENTRYPOINT [ "sh", "-c", "exec erigon \ + --datadir=/var/lib/erigon \ --metrics \ --metrics.addr=\"0.0.0.0\" \ --metrics.port=\"6060\" \ --private.api.addr=\"0.0.0.0:9090\" \ - ${ERIGON_EXTRA_OPTS}" ] \ No newline at end of file + --pprof \ + --pprof.addr=0.0.0.0 \ + --pprof.port=6061 \ + ${ERIGON_EXTRA_OPTS}" ] + diff --git a/rpcdaemon/Dockerfile b/rpcdaemon/Dockerfile index 08f5c56..ccf57ce 100644 --- a/rpcdaemon/Dockerfile +++ b/rpcdaemon/Dockerfile @@ -1,29 +1,6 @@ -FROM golang:1.16-alpine3.13 as builder +ARG UPSTREAM_VERSION -ARG git_commit -ENV GIT_COMMIT=$git_commit - -ARG git_branch -ENV GIT_BRANCH=$git_branch - -# for linters to avoid warnings. we won't use linters in Docker anyway -ENV LATEST_COMMIT="undefined" - -ARG UPSTREAM_VERSION - -RUN apk --no-cache add make gcc g++ linux-headers git bash ca-certificates libgcc libstdc++ - -WORKDIR /app - -RUN git clone -b ${UPSTREAM_VERSION} --recurse-submodules -j8 https://github.com/ledgerwatch/erigon.git /app -RUN go mod download -RUN make all - -FROM alpine:3.13 - -RUN apk add --no-cache ca-certificates libgcc libstdc++ tzdata - -COPY --from=builder /app/build/bin/* /usr/local/bin/ +FROM thorax/erigon:${UPSTREAM_VERSION} ENTRYPOINT [ "sh", "-c", "exec rpcdaemon \ --private.api.addr=\"erigon:9090\" \