-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
node_modules | ||
.env | ||
coverage | ||
coverage.json | ||
typechain | ||
typechain-types | ||
|
||
*.log | ||
|
||
# Circuits | ||
packages/circuits/build | ||
packages/circuits/inputs | ||
packages/circuits/*.ptau | ||
*.r1cs | ||
*.sym | ||
*.wasm | ||
*.c | ||
|
||
# Contracts | ||
packages/contracts/broadcast | ||
packages/contracts/cache | ||
packages/contracts/out | ||
packages/contracts/cache | ||
packages/contracts/test/build_integration/*.json | ||
packages/contracts/test/build_integration/*.zkey | ||
packages/contracts/test/build_integration/*.wasm | ||
packages/contracts/test/build_integration/*.txt | ||
|
||
# Relayer | ||
packages/relayer/sendgrid.env | ||
target | ||
packages/relayer/db/* | ||
packages/relayer/*.db | ||
packages/relayer/received_eml/*.eml | ||
packages/relayer/received_eml/*.json | ||
packages/relayer/proofs | ||
sql_database.db | ||
.sqlx | ||
|
||
# Prover | ||
packages/prover/build/* | ||
packages/prover/params/* | ||
packages/prover/__pycache__/* | ||
|
||
# Subgraphs | ||
packages/subgraph/build | ||
|
||
# Subgraphs | ||
packages/subgraph/build | ||
|
||
# Subgraphs | ||
packages/subgraph/build | ||
|
||
# Mac | ||
.DS_Store | ||
|
||
# mdbook | ||
book | ||
|
||
# Vs code settings | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# ------------------ Chef stage ------------------- | ||
# Use cargo chef to cache dependencies | ||
FROM rustlang/rust:nightly AS chef | ||
|
||
# Install cargo chef | ||
RUN cargo install cargo-chef | ||
|
||
# Work in app | ||
WORKDIR /app | ||
|
||
# ------------------ Planner stage ------------------- | ||
FROM chef as planner | ||
|
||
# Copy files into container | ||
COPY Cargo.toml Cargo.lock ./ | ||
COPY packages/relayer ./packages/relayer | ||
COPY packages/utils ./packages/utils | ||
COPY packages/scripts ./packages/scripts | ||
|
||
# Create a lockfile for cargo chef | ||
RUN cargo +nightly chef prepare --recipe-path recipe.json | ||
|
||
# ------------------ Builder stage ------------------- | ||
FROM chef AS builder | ||
WORKDIR /relayer | ||
|
||
# Copy over our lock file | ||
COPY --from=planner /app /relayer | ||
|
||
# Build for any AWS machine. Same as cargo build but caches dependencies with the chef to make builds faster. | ||
RUN cargo chef cook --release --recipe-path recipe.json | ||
|
||
### Above this all dependencies should be cached as long as our lock file stays the same | ||
|
||
# Build binary | ||
RUN cargo build --release | ||
|
||
# ------------------ Runtime stage ------------------- | ||
|
||
# Using super lightweight debian image to reduce overhead | ||
FROM ubuntu:latest AS runtime | ||
|
||
# Copy prebuild bin from the Builder stage | ||
COPY --from=builder /relayer/target/release/relayer /relayer/target/release/relayer | ||
COPY --from=builder /relayer/Cargo.toml /relayer/Cargo.toml | ||
COPY --from=builder /relayer/Cargo.lock /relayer/Cargo.lock | ||
|
||
EXPOSE 4500 | ||
|
||
CMD ["relayer/target/release/relayer"] | ||
|
||
# This cargo chef logic comes from https://github.com/LukeMathWalker/cargo-chef | ||
# Inspired by Huff: https://github.com/huff-language/huff-rs/blob/main/Dockerfile |