Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Compose Integration #93

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM rust:bullseye AS builder

RUN apt update && \
apt install -y build-essential pkg-config libssl-dev protobuf-compiler && \
mkdir /root/.nexus && \
cd /root/.nexus && \
git clone https://github.com/nexus-xyz/network-api && \
cd network-api && \
git -c advice.detachedHead=false checkout $(git rev-list --tags --max-count=1)

WORKDIR /root/.nexus/network-api/clients/cli

RUN cargo build --release --bin prover

FROM debian:bullseye-slim

RUN apt update && \
apt install -y ca-certificates && \
mkdir /root/.nexus

COPY --from=builder /root/.nexus/network-api/clients/cli/src /root/.nexus/src
COPY --from=builder /root/.nexus/network-api/clients/cli/target/release/prover /root/.nexus/prover

WORKDIR /root/.nexus

COPY entrypoint.sh .

RUN chmod +x entrypoint.sh

CMD ["./entrypoint.sh", "./prover", "beta.orchestrator.nexus.xyz"]
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ curl https://cli.nexus.xyz/ | sh

If you don't have Rust installed, you will be prompted to install it.

## Quick Start (Docker)

Make sure docker and docker compose have been installed on you machine. check documentation here :
- [Install Docker](https://docs.docker.com/engine/install/)
- [Install Docker Compose](https://docs.docker.com/compose/install/)

Update your `PROVER_ID` at `docker-compose.yml`. then run command below to start proving.
```bash
docker compose up -d
```

For see the logs you can run this commands
```bash
docker compose logs -f
```

## Prerequisites

### Linux
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3'
services:
nexus:
build: .
environment:
- PROVER_ID=PROVER_ID_HERE
11 changes: 11 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

if [ -z "${PROVER_ID}" ]; then
echo "Error: PROVER_ID environment variable is not set or is empty"
exit 1
fi

NEXUS_HOME=$HOME/.nexus
echo "$PROVER_ID" > $NEXUS_HOME/prover-id

exec "$@"