diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d3f93bd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +# Use the official Rust image as the base image +FROM rust:1.81 AS builder + +# Install protobuf compiler +RUN apt-get update && apt-get install -y protobuf-compiler git + +# Create a new directory for the application +WORKDIR /app + +# Clone the repository instead of copying local files +RUN git clone https://github.com/lndk-org/lndk . + +# Build dependencies and the project +RUN cargo build --release + +# Create a new stage with a minimal image +FROM debian:bookworm-slim AS final + +# Install necessary runtime dependencies +RUN apt-get update && \ + apt-get install -y libssl3 ca-certificates && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Copy the built executables from the builder stage +COPY --from=builder /app/target/release/lndk /usr/local/bin/lndk +COPY --from=builder /app/target/release/lndk-cli /usr/local/bin/lndk-cli + +# Set the startup command +CMD ["lndk"] diff --git a/sample-docker-compose.yaml b/sample-docker-compose.yaml new file mode 100644 index 0000000..7ab99a7 --- /dev/null +++ b/sample-docker-compose.yaml @@ -0,0 +1,42 @@ +services: + lnd: + container_name: lnd + image: docker.io/lightninglabs/lnd:v0.18.4-beta + restart: unless-stopped + stop_grace_period: 5m30s + volumes: + - ~/lnd:/root/.lnd + ports: + - "9735:9735" + - "10009:10009" + command: + lnd + --listen=0.0.0.0:9735 + --rpclisten=0.0.0.0:10009 + --bitcoin.active + --bitcoin.mainnet + --bitcoin.node=neutrino + --neutrino.addpeer=btcd-mainnet.lightning.computer + --tlsextradomain=lnd + --tlsextradomain=lndk + --accept-keysend + --fee.url=https://nodes.lightning.computer/fees/v1/btctestnet-fee-estimates.json + --protocol.custom-message=513 + --protocol.custom-nodeann=39 + --protocol.custom-init=39 + + lndk: + container_name: lndk + image: lndk + build: + context: . + dockerfile: Dockerfile + depends_on: [lnd] + restart: on-failure + stop_grace_period: 20s + volumes: + - ~/lnd:/lnd:ro + command: > + lndk --address=https://lnd:10009 --cert-path=/lnd/tls.cert --macaroon-path=/lnd/data/chain/bitcoin/mainnet/admin.macaroon + environment: + - RUST_LOG=info