diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4531a16 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM docker.io/library/node:9.2 + +ADD . /pegaswitch +WORKDIR /pegaswitch + +RUN npm install +RUN npm install pty.js + +EXPOSE 53 53/udp 80 8100 + +CMD node start.js --ip $IP_ADDR diff --git a/README.md b/README.md index e23180a..9e39cee 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,23 @@ Usage It should no longer be necessary to run `usefulscripts/SetupNew.js`, since PegaSwitch will now do it automatically. +## 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 =============