diff --git a/Dockerfile b/Dockerfile index 77d8a5f6..6001419a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,9 @@ RUN npm i COPY . /app +EXPOSE 1776 +EXPOSE 1777 + +VOLUME ["/app/data"] + CMD [ "npm", "start" ] diff --git a/README.md b/README.md index de3eb13e..2d85887d 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,33 @@ Coming Soon `docker pull ghcr.io/shocknet/lightning-pub:latest` +### Running the Docker Container + +To run the Docker container with persistent storage and port mapping, use the following command: + +```sh +docker run -d \ + --name lightning-pub \ + --network host \ + -p 1776:1776 \ + -p 1777:1777 \ + -v /path/to/local/data:/app/data \ + ghcr.io/shocknet/lightning-pub:latest +``` + +- `--network host`: Allows the container to use the host's network stack, enabling access to local services. +- `-p 1776:1776`: Maps the container's port 1776 to the host's port 1776. +- `-p 1777:1777`: Maps the container's port 1777 to the host's port 1777 (optional for management). +- `-v /path/to/local/data:/app/data`: Mounts a local directory to the container for persistent storage. + +### Accessing the Service + +Once the container is running, you can access the main service at `http://localhost:1776` and the optional management interface at `http://localhost:1777`. + +### Connecting to External Services + +Ensure that the container has access to necessary external services (e.g., LND node) by configuring the network settings appropriately. If using `--network host`, the container can access local services directly using `localhost` or `127.0.0.1`. + ## Manual CLI Installation #### Notes: @@ -120,4 +147,3 @@ Coming Soon > [!NOTE] > Connecting with wallet will create an account on the node, it will not show or have access to the full LND balance -