Skip to content

Commit

Permalink
disable clnrest in anticipation of clnrest-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
1ma committed Oct 30, 2024
1 parent 8170128 commit 14ac3a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
16 changes: 4 additions & 12 deletions core-lightning/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22-alpine AS trustedcoin
FROM golang:1.23-alpine AS trustedcoin

ARG TRUSTEDCOIN_VERSION=v0.8.2

Expand Down Expand Up @@ -58,10 +58,7 @@ RUN make install
COPY --from=trustedcoin /go/bin/trustedcoin /usr/local/libexec/c-lightning/plugins/


FROM alpine:3.19 AS final

ENV VIRTUAL_ENV=/opt/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
FROM alpine:3.20 AS final

COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /usr/local/libexec /usr/local/libexec
Expand All @@ -70,24 +67,19 @@ RUN apk add --no-cache \
ca-certificates \
libgcc \
libpq \
py3-pip \
&& python -m venv $VIRTUAL_ENV \
&& pip install -r /usr/local/libexec/c-lightning/plugins/clnrest/requirements.txt \
&& rm -rf /root/.cache \
&& addgroup --system cln \
&& adduser --system --disabled-password --shell /bin/false --gecos cln --ingroup cln cln \
&& mkdir -p /home/cln/.lightning/bitcoin \
&& chmod -R 700 /home/cln/.lightning \
&& echo "disable-plugin=bcli" >> /home/cln/.lightning/config \
&& echo "disable-plugin=wss-proxy" >> /home/cln/.lightning/config \
&& echo "clnrest-port=3010" >> /home/cln/.lightning/config \
&& echo "clnrest-host=0.0.0.0" >> /home/cln/.lightning/config \
&& echo "disable-plugin=clnrest" >> /home/cln/.lightning/config \
&& chown -R cln:cln /home/cln/.lightning

VOLUME /home/.cln/.lightning/bitcoin

USER cln

EXPOSE 3010 9735
EXPOSE 9735

CMD ["/usr/local/bin/lightningd", "--plugin", "/usr/local/libexec/c-lightning/plugins/trustedcoin"]
19 changes: 6 additions & 13 deletions core-lightning/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM golang:1.22-bookworm AS trustedcoin
FROM golang:1.23-bookworm AS trustedcoin

ARG TRUSTEDCOIN_VERSION=v0.8.2

ENV CGO_ENABLED=0

RUN go install -trimpath -ldflags="-d -s -w" github.com/nbd-wtf/trustedcoin@latest
RUN go install -trimpath -ldflags="-d -s -w" github.com/nbd-wtf/trustedcoin@${TRUSTEDCOIN_VERSION}


FROM debian:12-slim AS builder
Expand Down Expand Up @@ -61,9 +63,6 @@ COPY --from=trustedcoin /go/bin/trustedcoin /usr/local/libexec/c-lightning/plugi

FROM debian:12-slim AS final

ENV VIRTUAL_ENV=/opt/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /usr/local/libexec /usr/local/libexec

Expand All @@ -72,26 +71,20 @@ RUN apt-get update \
ca-certificates \
libpq5 \
python-is-python3 \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/* \
&& python -m venv $VIRTUAL_ENV \
&& pip install -r /usr/local/libexec/c-lightning/plugins/clnrest/requirements.txt \
&& rm -rf /root/.cache \
&& addgroup --system cln \
&& adduser --system --disabled-password --home /home/cln --shell /bin/false --gecos cln --ingroup cln cln \
&& mkdir -p /home/cln/.lightning/bitcoin \
&& chmod -R 700 /home/cln/.lightning \
&& echo "disable-plugin=bcli" >> /home/cln/.lightning/config \
&& echo "disable-plugin=wss-proxy" >> /home/cln/.lightning/config \
&& echo "clnrest-port=3010" >> /home/cln/.lightning/config \
&& echo "clnrest-host=0.0.0.0" >> /home/cln/.lightning/config \
&& echo "disable-plugin=clnrest" >> /home/cln/.lightning/config \
&& chown -R cln:cln /home/cln/.lightning

VOLUME /home/.cln/.lightning/bitcoin

USER cln

EXPOSE 3010 9735
EXPOSE 9735

CMD ["/usr/local/bin/lightningd", "--plugin", "/usr/local/libexec/c-lightning/plugins/trustedcoin"]

0 comments on commit 14ac3a1

Please sign in to comment.