-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a981a2
commit db510c8
Showing
4 changed files
with
35 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,59 @@ | ||
ARG BUILDER_DIR=/srv/lnp | ||
|
||
|
||
FROM rust:1.47.0-slim-buster as builder | ||
|
||
ARG SRC_DIR=/usr/local/src/lnp | ||
ARG BUILDER_DIR | ||
|
||
RUN apt-get update -y \ | ||
&& apt-get install -y \ | ||
libsqlite3-dev \ | ||
libssl-dev \ | ||
libzmq3-dev \ | ||
pkg-config | ||
|
||
ENV SRC=/usr/local/src/lnpnode | ||
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 license_header.txt README.md ${SRC_DIR}/ | ||
|
||
COPY doc ${SRC}/doc | ||
COPY shell ${SRC}/shell | ||
COPY src ${SRC}/src | ||
COPY build.rs Cargo.lock Cargo.toml codecov.yml config_spec.toml LICENSE license_header.txt README.md ${SRC}/ | ||
WORKDIR ${SRC_DIR} | ||
|
||
WORKDIR ${SRC} | ||
RUN mkdir "${BUILDER_DIR}" | ||
|
||
RUN cargo install --path . --bins --all-features | ||
RUN cargo install --path . --root "${BUILDER_DIR}" --bins --all-features | ||
|
||
|
||
FROM debian:buster-slim | ||
|
||
ARG BUILDER_DIR | ||
ARG BIN_DIR=/usr/local/bin | ||
ARG DATA_DIR=/var/lib/lnp | ||
ARG USER=lnpd | ||
|
||
RUN apt-get update -y \ | ||
&& apt-get install -y \ | ||
libzmq3-dev \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
COPY --from=builder /usr/local/cargo/bin/lnp-cli /usr/local/bin/ | ||
COPY --from=builder /usr/local/cargo/bin/connectiond /usr/local/bin/ | ||
|
||
ENV APP_DIR=/srv/app USER=lnpnode | ||
ENV CONF=${APP_DIR}/config.toml | ||
|
||
RUN adduser --home ${APP_DIR} --shell /bin/bash --disabled-login \ | ||
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} | ||
|
||
RUN touch ${CONF} \ | ||
&& mkdir ${APP_DIR}/.lnp_node | ||
VOLUME "$DATA_DIR" | ||
|
||
WORKDIR ${APP_DIR} | ||
EXPOSE 9735 | ||
|
||
EXPOSE 9666 9735 | ||
ENTRYPOINT ["lnpd"] | ||
|
||
ENTRYPOINT ["connectiond", "-vvvv", "--listen", "--config=/srv/app/config.toml"] | ||
CMD ["-vvv", "--data-dir", "/var/lib/lnp"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters