Browse Source

[Docker] Fix: Bind socat to the right port

ppa-0.6.1
nicolas.dorier 6 years ago
committed by Christian Decker
parent
commit
aeafe4dbe7
  1. 4
      Dockerfile
  2. 2
      README.md
  3. 3
      tools/docker-entrypoint.sh

4
Dockerfile

@ -89,7 +89,7 @@ RUN apk add --update curl && \
rm -rf glibc.apk glibc-bin.apk /var/cache/apk/* rm -rf glibc.apk glibc-bin.apk /var/cache/apk/*
ENV LIGHTNINGD_DATA=/root/.lightning ENV LIGHTNINGD_DATA=/root/.lightning
ENV LIGHTNINGD_PORT=9735 ENV LIGHTNINGD_RPC_PORT=9835
VOLUME [ "/root/.lightning" ] VOLUME [ "/root/.lightning" ]
@ -99,5 +99,5 @@ COPY --from=builder /opt/bitcoin/bin /usr/bin
COPY --from=builder /opt/litecoin/bin /usr/bin COPY --from=builder /opt/litecoin/bin /usr/bin
COPY tools/docker-entrypoint.sh entrypoint.sh COPY tools/docker-entrypoint.sh entrypoint.sh
EXPOSE 9735 EXPOSE 9735 9835
ENTRYPOINT [ "./entrypoint.sh" ] ENTRYPOINT [ "./entrypoint.sh" ]

2
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: 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`: 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`:

3
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 \ while read -r i; do if [ "$i" = "lightning-rpc" ]; then break; fi; done \
< <(inotifywait -e create,open --format '%f' --quiet "$LIGHTNINGD_DATA" --monitor) < <(inotifywait -e create,open --format '%f' --quiet "$LIGHTNINGD_DATA" --monitor)
echo "C-Lightning started" 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 %- fg %-
else else
lightningd "$@" lightningd "$@"

Loading…
Cancel
Save