From 5ef030ced5a8dacf9fa70a826ba41ebdba8ecf8f Mon Sep 17 00:00:00 2001 From: Marcel Wysocki Date: Wed, 13 Dec 2017 14:06:56 +0100 Subject: [PATCH 1/3] Add Dockerfile and instructions --- Dockerfile | 10 ++++++++++ README.docker.md | 21 +++++++++++++++++++++ README.md | 4 ++++ 3 files changed, 35 insertions(+) create mode 100644 Dockerfile create mode 100644 README.docker.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6ec6978 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM docker.io/library/node:9.2 + +ADD . /pegaswitch +WORKDIR /pegaswitch + +RUN npm install + +EXPOSE 53 53/udp 80 8100 + +CMD node start.js --ip $IP_ADDR diff --git a/README.docker.md b/README.docker.md new file mode 100644 index 0000000..dbf4ab4 --- /dev/null +++ b/README.docker.md @@ -0,0 +1,21 @@ +Overview +======== +This document will describe how to build and run pegaswitch within a docker container. + +Building +======== +The container image is based on the official `nodejs:9.2` image. +To build the docker container image simply run: + +`docker build -t reswitched/pegaswitch .` + + +Running +======= +To run the docker container container first you have to figure out your +local network IP address. + +1. Run `ip a` +2. Run `docker run -ti -p 53:53/udp -p 53:53 -p 80:80 -p 8100:8100 --env TERM --env IP_ADDR={your IP address from the prior command} reswitched/pegaswitch` + +If you fail to set the `IP_ADDR` variable the container will not start. diff --git a/README.md b/README.md index cf6f672..2513518 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ Installation 2. Clone this repository 3. Run `npm install` +Run in docker +============= +See [README.docker.md](README.docker.md) + Usage ===== From 02472055549aea9e70e6282e3dd892d91457c9a9 Mon Sep 17 00:00:00 2001 From: Marcel Wysocki Date: Wed, 13 Dec 2017 14:15:59 +0100 Subject: [PATCH 2/3] merge docker info into main readme --- README.docker.md | 21 --------------------- README.md | 21 +++++++++++++++++---- 2 files changed, 17 insertions(+), 25 deletions(-) delete mode 100644 README.docker.md diff --git a/README.docker.md b/README.docker.md deleted file mode 100644 index dbf4ab4..0000000 --- a/README.docker.md +++ /dev/null @@ -1,21 +0,0 @@ -Overview -======== -This document will describe how to build and run pegaswitch within a docker container. - -Building -======== -The container image is based on the official `nodejs:9.2` image. -To build the docker container image simply run: - -`docker build -t reswitched/pegaswitch .` - - -Running -======= -To run the docker container container first you have to figure out your -local network IP address. - -1. Run `ip a` -2. Run `docker run -ti -p 53:53/udp -p 53:53 -p 80:80 -p 8100:8100 --env TERM --env IP_ADDR={your IP address from the prior command} reswitched/pegaswitch` - -If you fail to set the `IP_ADDR` variable the container will not start. diff --git a/README.md b/README.md index 2513518..01276b5 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,6 @@ Installation 2. Clone this repository 3. Run `npm install` -Run in docker -============= -See [README.docker.md](README.docker.md) - Usage ===== @@ -29,6 +25,23 @@ Usage 4. Run a connection test to trigger the Captive Portal. (Likewise, going into an update page will do the same.) 5. **STRONG SUGGESTION**: If this is your first time running PegaSwitch on a new console, run the command `evalfile usefulscripts/SetupNew.js` to set up useful settings. +## Through Docker +### Building +The container image is based on the official `nodejs:9.2` image. +To build the docker container image simply run: + +`docker build -t reswitched/pegaswitch .` + + +### Running +To run the docker container container first you have to figure out your +local network IP address. + +1. Run `ip a` +2. Run `docker run -ti -p 53:53/udp -p 53:53 -p 80:80 -p 8100:8100 --env TERM --env IP_ADDR={your IP address from the prior command} reswitched/pegaswitch` + +If you fail to set the `IP_ADDR` variable the container will not start. + Documentation ============= From a6220168ff328de6de7b5d868255343419961693 Mon Sep 17 00:00:00 2001 From: Marcel Wysocki Date: Thu, 14 Dec 2017 14:06:49 +0100 Subject: [PATCH 3/3] install pty.js --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 6ec6978..4531a16 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ ADD . /pegaswitch WORKDIR /pegaswitch RUN npm install +RUN npm install pty.js EXPOSE 53 53/udp 80 8100