-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
39 lines (26 loc) · 946 Bytes
/
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
FROM docker.io/paritytech/ci-linux:production as builder
ARG PROFILE=release
ARG BIN=dorafactory-node
WORKDIR /dorafactory
COPY . /dorafactory
RUN cargo build --$PROFILE --bin $BIN
# ===== SECOND STAGE ======
FROM docker.io/library/ubuntu:20.04
ARG PROFILE=release
ARG BIN=dorafactory-node
ENV BIN_PATH=/usr/local/bin/$BIN
COPY --from=builder /dorafactory/target/$PROFILE/$BIN /usr/local/bin
RUN apt update -y \
&& apt install -y ca-certificates libssl-dev \
&& useradd -m -u 1000 -U -s /bin/sh -d /dorafactory dorafactory \
&& mkdir -p /dorafactory/.local \
&& mkdir /data \
&& chown -R dorafactory:dorafactory /data \
&& ln -s /data /dorafactory/.local/share \
&& chown -R dorafactory:dorafactory /dorafactory/.local/share
COPY --from=builder /dorafactory/entrypoint.sh /dorafactory
USER dorafactory
WORKDIR /dorafactory
EXPOSE 30333 9933 9944
VOLUME ["/data"]
ENTRYPOINT ["/dorafactory/entrypoint.sh"]