-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (25 loc) · 896 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
FROM dappforce/cargo-chef:latest AS chef
WORKDIR /subsocial
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /subsocial/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --release
FROM debian:buster-slim
COPY --from=builder /subsocial/target/release/xsocial-node /usr/local/bin
RUN useradd -m -u 1000 -U -s /bin/sh -d /subsocial subsocial && \
apt update && apt install curl -y && \
mkdir -p /subsocial/.local/share && \
mkdir /data && \
chown -R subsocial:subsocial /data && \
chown -R subsocial:subsocial /bin && \
ln -s /data /subsocial/.local/share/xsocial-node
USER subsocial
EXPOSE 30333 9933 9944
VOLUME ["/data"]
ENTRYPOINT ["/usr/local/bin/xsocial-node"]