This commit is contained in:
benthecarman
2024-07-31 17:04:32 -05:00
parent 5d20b5f91d
commit b8b286a599
2 changed files with 62 additions and 0 deletions

View File

@@ -77,6 +77,19 @@ services:
- "9735:9735"
- "10009:10009"
- "8081:8081"
lndk:
build: ./lndk
restart: unless-stopped
user: "0:1000"
logging: *default-logging
depends_on:
- lnd
command: --address=https://lnd:10009 --cert-path=/root/.lnd/tls.cert --macaroon-path=/root/.lnd/data/chain/bitcoin/signet/admin.macaroon --log-level=trace --grpc-host=0.0.0.0
environment:
- RUST_BACKTRACE=1
volumes:
- ~/volumes/lndk:/root/.lndk
- ~/volumes/.lnd:/root/.lnd:ro
rgs_server:
container_name: "rgs-server"
logging: *default-logging

49
lndk/Dockerfile Normal file
View File

@@ -0,0 +1,49 @@
#################
# Builder image #
#################
FROM rust:1.78-bookworm AS builder
# References for lndk
ARG LNDK_SOURCE=https://github.com/lndk-org/lndk.git
ARG LNDK_REF=60e17a0c94177f7d2d160aa08f5cc32a1274b51e
# Add utils
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
protobuf-compiler \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory in the Docker image
WORKDIR /usr/src
# Grab and install the latest version of lndk
RUN git clone ${LNDK_SOURCE} . \
&& git reset --hard ${LNDK_REF} \
&& cargo build --release
# Copy the compiled binaries to /bin/
RUN cp ./target/release/lndk /bin/
RUN cp ./target/release/lndk-cli /bin/
###############
# final image #
###############
FROM debian:bookworm-slim AS final
# Add utils
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy the compiled binaries from the builder image
COPY --from=builder /bin/lndk /usr/local/bin/
COPY --from=builder /bin/lndk-cli /usr/local/bin/
# Expose grpc port
EXPOSE 7000
ENTRYPOINT ["lndk"]