-
Notifications
You must be signed in to change notification settings - Fork 46
/
Dockerfile
36 lines (26 loc) · 1.13 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
FROM rust:1.77.2-slim-bookworm as builder
ARG PROFILE=release
WORKDIR /nodle-chain
COPY . /nodle-chain
RUN apt-get update && apt-get install -qy cmake pkg-config libssl-dev git clang build-essential curl protobuf-compiler
RUN rustup component add rust-src && rustup target add wasm32-unknown-unknown --toolchain stable
RUN cargo build -p nodle-parachain --$PROFILE && \
bunzip2 node/res/paradis.json.bz2
# ===== SECOND STAGE ======
FROM rust:1.77.2-slim-bookworm as runtime
ARG PROFILE=release
RUN install -d /usr/local/share/nodle
COPY --from=builder /nodle-chain/target/$PROFILE/nodle-parachain /usr/local/bin
COPY --from=builder /nodle-chain/node/res/paradis.json /usr/local/share/nodle
RUN mv /usr/share/ca* /tmp && \
rm -rf /usr/share/* && \
mv /tmp/ca-certificates /usr/share/ && \
rm -rf /usr/lib/python* && \
useradd -m -u 1000 -U -s /bin/sh -d /nodle-chain nodle-chain && \
mkdir -p /nodle-chain/.local/share/nodle-chain && \
chown -R nodle-chain:nodle-chain /nodle-chain/.local && \
ln -s /nodle-chain/.local/share/nodle-chain /data
USER nodle-chain
EXPOSE 30333 9933 9944
VOLUME ["/data"]
ENTRYPOINT ["nodle-parachain"]