Thomas E Lackey
167cd2839c
Rebase of #1 onto real `v5` branch. * Updates to the v5 schema, by linking the statediff plugin (as of this branch cerc-io/plugeth-statediff#15). This replaces the existing builder code. * Adds basic CI workflows * Updates Docker config and docs, cleans up some things Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com> Reviewed-on: #2 Co-authored-by: Roy Crihfield <roy@manteia.ltd> Co-committed-by: Roy Crihfield <roy@manteia.ltd> Co-authored-by: Roy Crihfield <roy@manteia.ltd> Reviewed-on: #3
38 lines
929 B
Docker
38 lines
929 B
Docker
FROM golang:1.19-alpine as builder
|
|
|
|
RUN apk add --no-cache git gcc musl-dev binutils-gold
|
|
# DEBUG
|
|
RUN apk add busybox-extras
|
|
|
|
WORKDIR /eth-statediff-service
|
|
|
|
ARG GIT_VDBTO_TOKEN
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN if [ -n "$GIT_VDBTO_TOKEN" ]; then git config --global url."https://$GIT_VDBTO_TOKEN:@git.vdb.to/".insteadOf "https://git.vdb.to/"; fi && \
|
|
go mod download && \
|
|
rm -f ~/.gitconfig
|
|
COPY . .
|
|
|
|
RUN go build -ldflags '-extldflags "-static"' -o eth-statediff-service .
|
|
|
|
FROM alpine
|
|
|
|
ARG USER="vdbm"
|
|
ARG EXPOSE_PORT=8545
|
|
ARG CONFIG_FILE="./environments/docker.toml"
|
|
|
|
RUN apk --no-cache add su-exec bash
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /eth-statediff-service/$CONFIG_FILE config.toml
|
|
COPY --from=builder /eth-statediff-service/startup_script.sh .
|
|
|
|
# keep binaries immutable
|
|
COPY --from=builder /eth-statediff-service/eth-statediff-service eth-statediff-service
|
|
|
|
EXPOSE $EXPOSE_PORT
|
|
|
|
ENTRYPOINT ["/app/startup_script.sh"]
|