From ffd87988c828f396936f58a96ee6a6137b0652d6 Mon Sep 17 00:00:00 2001 From: Erfan Besharat Date: Thu, 8 Jul 2021 19:17:40 +0430 Subject: [PATCH 1/2] Add new CLI Dockerfile --- Dockerfile | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 90e3aef2..78ea8060 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,19 @@ -FROM node:12.18.0-alpine3.9 +FROM node:lts-alpine + +EXPOSE 9835 + +VOLUME [ "/lnd", "/data" ] WORKDIR /usr/src/app +RUN apk update && apk upgrade && \ + apk add --no-cache bash git openssh ADD ./package.json /usr/src/app/package.json ADD ./yarn.lock /usr/src/app/yarn.lock -#RUN useradd app && \ -# mkdir -p /home/app/.lnd -RUN apk update && apk upgrade && \ - apk add --no-cache bash git openssh -RUN yarn install + +RUN yarn ADD . /usr/src/app -RUN ls /usr/src/app -RUN chmod +x ./docker-start.sh -#ADD ./tls.cert /usr/src/app/tls.cert -#ADD ./admin.macaroon /usr/src/app/admin.macaroon - -# && \ -# chown -R app:app /home/app && \ -# chown -R app:app /usr/src/app && \ -# chown -R app:app /start.sh - -#ARG lnd_address -#ENV LND_ADDR=$lnd_address -EXPOSE 9835 -CMD ["./docker-start.sh"] \ No newline at end of file +ENTRYPOINT [ "node", "main.js" ] \ No newline at end of file From 3d1ea17230b0b50e9dc32d36154401411c1b1927 Mon Sep 17 00:00:00 2001 From: Erfan Besharat Date: Thu, 8 Jul 2021 19:44:33 +0430 Subject: [PATCH 2/2] Add Docker usage to README --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 15388634..eeccaff3 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,12 @@ This is an alpha release of the Shockwallet backend service, providing a wrapper Run this service on your Lightning node and connect with a mobile device or desktop browser. +--- +- [Easy Installation](#easy-installation) +- [Manual Installation](#manual-installation) +- [Docker Usage](#docker-usage) +- [Docker for Raspberry Pi](#docker-for-raspberry-pi) +--- ### Easy Installation For easy setup on your Laptop/Desktop, [a node wizard is available here.](https://github.com/shocknet/wizard) @@ -47,6 +53,18 @@ yarn install *Optionally, add the `-t` flag to route through a tunnel.rip webserver for zero-configuration networking. All communication between the api and wallet is end-to-end encrypted and your privacy is protected.* +### Docker Usage +To run ShockAPI in a fully isolated environment you can use the Docker image +provided on the Docker Hub and easily interact with API's CLI interface and flags. + +Example of listing available configuration flags: +``` +docker run --rm shockwallet/api:latest --help +``` +Example of running an local instance: +``` +docker run shockwallet/api:latest -h 0.0.0.0 -c +``` ### Docker for Raspberry Pi