Skip to content

Commit

Permalink
feat: Containerize relayers (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
mertwole committed Sep 24, 2024
1 parent f628119 commit 4787429
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Rust build directory
target

# Resource files
audits
images
LICENSE
*.md

# Git directory
.git

# IDE-generated files
.vscode
.idea

# Relayer config and intermediate data
data
proof_storage
onchain_proof_storage_data
.env
GenesisConfig.toml

# Ethereum-related
ethereum/cache
ethereum/out
ethereum/broadcast
45 changes: 45 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM ubuntu:22.04 as builder
SHELL ["/bin/bash", "-c"]

# Install deps
RUN apt-get update
RUN apt-get install -y \
curl \
build-essential \
pkg-config \
libssl-dev \
cmake \
git \
wget \
gcc \
protobuf-compiler \
clang

# Install rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

# Install wasm-opt
RUN cargo install wasm-opt

# Install go
ENV GO_VERSION 1.20.1
RUN wget -P /tmp "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz"
RUN tar -C /usr/local -xzf "/tmp/go${GO_VERSION}.linux-amd64.tar.gz"
RUN rm "/tmp/go${GO_VERSION}.linux-amd64.tar.gz"
ENV PATH /go/bin:/usr/local/go/bin:$PATH

# Install foundry
RUN curl -L https://foundry.paradigm.xyz | bash
RUN /root/.foundry/bin/foundryup
ENV PATH="/root/.foundry/bin:${PATH}"

COPY . .

# Build relayer
RUN cargo build -p relayer --release

# Compose final image
FROM ubuntu:22.04
COPY --from=builder /target/release/relayer /usr/local/bin/relayer
CMD ["relayer"]

0 comments on commit 4787429

Please sign in to comment.