From d8f40e24faa20845b2497e6914bcbc40745e0d82 Mon Sep 17 00:00:00 2001 From: kant Date: Mon, 2 Oct 2023 00:59:52 -0700 Subject: [PATCH] Adding config and docker files --- Dockerfile | 28 ++++++++++++++++++++++++++++ config/config.yml | 9 +++++++++ 2 files changed, 37 insertions(+) create mode 100644 Dockerfile create mode 100644 config/config.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..6fead987 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# --- Build Stage --- +FROM golang:1.21.1 AS builder + +# Set the current working directory inside the container +WORKDIR /app + +# Copy go mod and sum files +COPY go.mod go.sum ./ + +# Download all dependencies +RUN go mod download + +# Copy the entire directory to the container +COPY . . + +# Build the application +RUN CGO_ENABLED=0 GOOS=linux go build -o mev-commit ./cmd/main.go + +# --- Production Stage --- +FROM alpine:latest + +# Copy the binary from the builder stage +COPY --from=builder /app/mev-commit /mev-commit + +EXPOSE 13522 13523 + +CMD ["/mev-commit"] + diff --git a/config/config.yml b/config/config.yml new file mode 100644 index 00000000..0c36d940 --- /dev/null +++ b/config/config.yml @@ -0,0 +1,9 @@ +priv_key_file: ~/.mev-commit/keys/node1 +peer_type: builder +p2p_port: 13524 +http_port: 13525 +secret: hello +log_fmt: text +log_level: debug +bootnodes: + - /ip4/localhost/tcp/13522/p2p/26Uiu2HAm1T4Pc777L6VerTUXMDS5VcHmBrAW4EUKjH5EXoRtB9Ft