forked from elysium-foundation/elysium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
66 lines (49 loc) · 2.12 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Node for Elysium
#
# Requires to run from repository root and to copy the binary in the build folder (part of the release workflow)
FROM debian:stable AS builder
# Branch or tag to build moonbeam from
ARG RUSTFLAGS=""
ENV RUSTFLAGS=$RUSTFLAGS
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /elysium
RUN echo "*** Installing Basic dependencies ***"
RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates
RUN apt install --assume-yes git clang curl libssl-dev llvm libudev-dev make protobuf-compiler pkg-config
RUN set -e
RUN echo "*** Installing Rust environment ***"
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:$PATH"
RUN rustup default stable
# rustup version are pinned in the rust-toolchain file
COPY . .
# Print target cpu
RUN rustc --print target-cpus
RUN echo "*** Building Elysium ***"
RUN cargo build --locked --release
FROM debian:stable-slim
LABEL description="Multistage Docker image for Elysium | The Green Blockchain for AI, Metaverse and web3 Game Projects" \
io.parity.image.type="mainnet" \
io.parity.image.authors="[email protected]" \
io.parity.image.vendor="Elysium Foundation" \
io.parity.image.description="Elysium | The Green Blockchain for AI, Metaverse and web3 Game Projects" \
io.parity.image.source="https://github.com/elysium-foundation/elysium" \
io.parity.image.documentation="https://docs.elysiumchain.tech/"
RUN useradd -m -u 1000 -U -s /bin/sh -d /elysium elysium && \
mkdir -p /elysium/.local/share && \
mkdir /data && \
chown -R elysium:elysium /data && \
ln -s /data /elysium/.local/share/elysium && \
rm -rf /usr/sbin
USER elysium
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder --chown=elysium /elysium/target/release/elysium /elysium/elysium
COPY --from=builder --chown=elysium /elysium/elysiumSpecRaw.json /usr/local/bin/
RUN chmod uog+x /elysium/elysium
# 30333 for parachain p2p
# 30334 for relaychain p2p
# 9944 for Websocket & RPC call
# 9615 for Prometheus (metrics)
EXPOSE 30333 30334 9944 9615
VOLUME ["/data"]
ENTRYPOINT ["/elysium/elysium"]