Skip to content

Commit

Permalink
Merge pull request #6 from zama-ai/petar/update-docker
Browse files Browse the repository at this point in the history
Use rust:bullseye for the Docker image
  • Loading branch information
dartdart26 authored Jul 13, 2023
2 parents 02ee014 + 14fb0f4 commit cb91b62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit cb91b62

Please sign in to comment.