diff --git a/Dockerfile b/Dockerfile index 39737ad72..50f1dd6d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -89,7 +89,7 @@ RUN apk add --update curl && \ rm -rf glibc.apk glibc-bin.apk /var/cache/apk/* ENV LIGHTNINGD_DATA=/root/.lightning -ENV LIGHTNINGD_PORT=9735 +ENV LIGHTNINGD_RPC_PORT=9835 VOLUME [ "/root/.lightning" ] @@ -99,5 +99,5 @@ COPY --from=builder /opt/bitcoin/bin /usr/bin COPY --from=builder /opt/litecoin/bin /usr/bin COPY tools/docker-entrypoint.sh entrypoint.sh -EXPOSE 9735 +EXPOSE 9735 9835 ENTRYPOINT [ "./entrypoint.sh" ] diff --git a/README.md b/README.md index 080aaab59..a8f31e9e0 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ If you build the image yourself, you can use the build arg `DEVELOPER=1` to buil It has the following environment variable: -* `EXPOSE_TCP` default to false, if true, use expose c-lightning on port 9735. (Use this only for testing) +* `EXPOSE_TCP` default to false, if true, use expose c-lightning RPC on port 9835. (Use this only for testing) Here is an example of a docker-compose file with bitcoind and c-lightning on `testnet` which expose litecoin's rpc interface on default ports `18332` and c-lightning API on port `9735`: diff --git a/tools/docker-entrypoint.sh b/tools/docker-entrypoint.sh index e918c3622..bb55d6856 100755 --- a/tools/docker-entrypoint.sh +++ b/tools/docker-entrypoint.sh @@ -10,8 +10,9 @@ if [ "$EXPOSE_TCP" == "true" ]; then while read -r i; do if [ "$i" = "lightning-rpc" ]; then break; fi; done \ < <(inotifywait -e create,open --format '%f' --quiet "$LIGHTNINGD_DATA" --monitor) echo "C-Lightning started" + echo "C-Lightning started, RPC available on port $LIGHTNINGD_RPC_PORT" - socat "TCP4-listen:$LIGHTNINGD_PORT,fork,reuseaddr" "UNIX-CONNECT:$LIGHTNINGD_DATA/lightning-rpc" & + socat "TCP4-listen:$LIGHTNINGD_RPC_PORT,fork,reuseaddr" "UNIX-CONNECT:$LIGHTNINGD_DATA/lightning-rpc" & fg %- else lightningd "$@"