diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..93f1361 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +npm-debug.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e479d33 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM node:carbon +WORKDIR /opt/nanotip +COPY . . +RUN npm install +ENV HOST=0.0.0.0 +EXPOSE 9115 +CMD node ./nanotip diff --git a/README.md b/README.md index 10b7a9c..54a084c 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,23 @@ $ nanotipd --help $ nanotipd -c http://localhost:9112 -t chargeSecretToken ``` + +## Running with Docker + +Nantotip includes a Dockerfile to allow for fast setup using a docker container based on node:carbon. To run from the container with port 9116 exposed, first setup [Lightning Charge](https://github.com/ElementsProject/lightning-charge), then build the image with: + +```bash +$ docker build -t elements_project/nanotip . +``` + +and then run with: + +```bash +$ docker run -p 9115:9115 -e CHARGE_URL=http://[charge-url]/ -e CHARGE_TOKEN=[access-token] elements_project/nanotip +``` + +That's it! The web server should now be running on port 9115 and ready to accept payments. + ## License MIT