diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..395b16e0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +.circleci +.git +.github +.gitignore +.idea +.vscode + +ci +target diff --git a/.gitignore b/.gitignore index 088ba6ba..1bdce877 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk +config.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..178dc986 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +# BUILD IMAGE --------------------------------------------------------- + +FROM rust:1.67.0-slim-bullseye AS builder + +# Using backports for go 1.19 +RUN echo 'deb http://deb.debian.org/debian bullseye-backports main' \ + >> /etc/apt/sources.list + +# Dependecies for publishing documentation and building waku-bindings. +RUN apt-get update && apt-get install -yq \ + git clang \ + golang-src/bullseye-backports \ + golang-doc/bullseye-backports \ + golang/bullseye-backports + +WORKDIR /nomos +COPY . . + +RUN cargo build --release -p mockpool-node + +# NODE IMAGE ---------------------------------------------------------- + +FROM bitnami/minideb:latest + +LABEL maintainer="augustinas@status.im" +LABEL source="https://github.com/logos-co/nomos-research" +LABEL description="Nomos node image" + +# nomos default ports +EXPOSE 3000 8080 9000 60000 + +COPY --from=builder /nomos/target/release/mockpool-node /usr/bin/nomos-node +COPY config.yml.example /etc/nomos/config.yml + +ENTRYPOINT ["nomos-node"] diff --git a/README.md b/README.md index 87794f57..aa138f12 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,17 @@ # nomos-research Nomos blockchain node mvp + +## Docker + +To build and run a docker container with nomos node run: + +```bash +docker build -t nomos . +docker run nomos /etc/nomos/config.yml +``` + +To run a node with a different configuration run: + +```bash +docker run -v /path/to/config.yml:/etc/nomos/config.yml nomos /etc/nomos/config.yml +``` diff --git a/config.yml.example b/config.yml.example new file mode 100644 index 00000000..99001893 --- /dev/null +++ b/config.yml.example @@ -0,0 +1,16 @@ +log: + backend: "Stdout" + format: "Json" + level: "debug" +network: + backend: + host: 0.0.0.0 + port: 3000 + log_level: "fatal" + nodeKey: null + discV5BootstrapNodes: [] + initial_peers: [] +http: + backend: + address: 0.0.0.0:8080 + cors_origins: []