joystream-node.Dockerfile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. FROM joystream/rust-builder AS builder
  2. LABEL description="Compiles all workspace artifacts"
  3. WORKDIR /joystream
  4. COPY . /joystream
  5. # Build all cargo crates
  6. # Ensure our tests and linter pass before actual build
  7. ENV WASM_BUILD_TOOLCHAIN=nightly-2020-05-23
  8. RUN BUILD_DUMMY_WASM_BINARY=1 cargo clippy --release --all -- -D warnings && \
  9. cargo test --release --all && \
  10. cargo build --release
  11. FROM debian:stretch
  12. LABEL description="Joystream node"
  13. WORKDIR /joystream
  14. COPY --from=builder /joystream/target/release/joystream-node /joystream/node
  15. COPY --from=builder /joystream/target/release/wbuild/joystream-node-runtime/joystream_node_runtime.compact.wasm /joystream/runtime.compact.wasm
  16. COPY --from=builder /joystream/target/release/chain-spec-builder /joystream/chain-spec-builder
  17. # confirm it works
  18. RUN /joystream/node --version
  19. # https://manpages.debian.org/stretch/coreutils/b2sum.1.en.html
  20. # RUN apt-get install coreutils
  21. # print the blake2 256 hash of the wasm blob
  22. RUN b2sum -l 256 /joystream/runtime.compact.wasm
  23. # print the blake2 512 hash of the wasm blob
  24. RUN b2sum -l 512 /joystream/runtime.compact.wasm
  25. EXPOSE 30333 9933 9944
  26. # Use these volumes to persits chain state and keystore, eg.:
  27. # --base-path /data
  28. # optionally separate keystore (otherwise it will be stored in the base path)
  29. # --keystore-path /keystore
  30. # if base-path isn't specified, chain state is stored inside container in ~/.local/share/joystream-node/
  31. # which is not ideal
  32. VOLUME ["/data", "/keystore"]
  33. ENTRYPOINT ["/joystream/node"]