From 14fb0f4513bafd91a4bbf4bb899b4d18edf114d2 Mon Sep 17 00:00:00 2001 From: Petar Ivanov <29689712+dartdart26@users.noreply.github.com> Date: Thu, 13 Jul 2023 14:01:15 +0300 Subject: [PATCH] Use rust:bullseye for the Docker image --- Dockerfile | 6 ++++-- README.md | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f3a408d..a04e1e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,17 @@ -FROM rust:buster as builder +FROM rust:1.70-bullseye AS builder RUN apt-get update && apt-get install -y clang WORKDIR /usr/local/app ADD . . RUN cargo build --release -FROM debian:bullseye-slim +FROM rust:1.70-slim-bullseye WORKDIR /usr/local/app RUN apt-get update && apt-get install -y clang RUN apt-get install libc6 -y COPY --from=builder /usr/local/app/target/release/fhevm-requires-db . COPY --from=builder /usr/local/app/Rocket.toml . +EXPOSE 8001/tcp + CMD ["/usr/local/app/fhevm-requires-db"] diff --git a/README.md b/README.md index e33e6e0..7d4842f 100644 --- a/README.md +++ b/README.md @@ -61,11 +61,18 @@ We use RocksDB as an underlying key-value store. We've chosen it, because it is Since the oracle is the only node that puts require results into the database and since all nodes (oracle and non-oracle ones) execute smart contract code at the same time, there is a race condition between the oracle putting a result and any other node reading it. Currently, the solution to this problem is to use a `WaitCache` that keeps pending key-values in memory for a limited period of time. Additionally, it allows a get request to wait until the requested key is put by the oracle. ## Build and Run +### Local ```bash cargo build --release cargo run --release ``` +### Docker +```bash +docker build -t fhevm-requires-db:latest . +docker run -d -p 8001:8001 fhevm-requires-db:latest +``` + ## Configuration We use the Rocket-provided configuration file - [Rocket.toml](Rocket.toml). It supports a number of rocket-specific configuration options as documented here: https://rocket.rs/v0.5-rc/guide/configuration/#configuration