forked from farcaster-project/farcaster-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (39 loc) · 1.3 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
ARG BUILDER_DIR=/srv/farcaster
FROM rust:1.55.0-slim-buster as builder
ARG SRC_DIR=/usr/local/src/farcaster
ARG BUILDER_DIR
RUN apt-get update -y && apt-get install -y --no-install-recommends apt-utils
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
libssl-dev \
pkg-config \
build-essential \
cmake
WORKDIR "$SRC_DIR"
COPY doc ${SRC_DIR}/doc
COPY shell ${SRC_DIR}/shell
COPY src ${SRC_DIR}/src
COPY build.rs Cargo.lock Cargo.toml codecov.yml config_spec.toml \
LICENSE README.md ${SRC_DIR}/
WORKDIR ${SRC_DIR}
RUN mkdir "${BUILDER_DIR}"
RUN cargo install --path . --root "${BUILDER_DIR}" --bins --all-features --locked
FROM debian:buster-slim
ARG BUILDER_DIR
ARG BIN_DIR=/usr/local/bin
ARG DATA_DIR=/var/lib/farcaster
ARG USER=farcasterd
RUN apt-get update -y \
&& apt-get install -y \
libzmq3-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN adduser --home "${DATA_DIR}" --shell /bin/bash --disabled-login \
--gecos "${USER} user" ${USER}
COPY --from=builder --chown=${USER}:${USER} \
"${BUILDER_DIR}/bin/" "${BIN_DIR}"
WORKDIR "${BIN_DIR}"
USER ${USER}
VOLUME "$DATA_DIR"
EXPOSE 9735 9981
ENTRYPOINT ["farcasterd"]
CMD ["--data-dir", "/var/lib/farcaster", "-x", "lnpz://0.0.0.0:9981/?api=esb", "--help"]