Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Improved Docker + Docker-Compose Functionality #78

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:latest

EXPOSE 53
EXPOSE 80
EXPOSE 8100

WORKDIR /opt/app

COPY . /opt/app/.

RUN npm install
RUN npm install pty.js

CMD ["npm", "start"]
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@
Installation
============

1. Install the latest version of node from [nodejs.org](https://nodejs.org)
2. Clone this repository
3. Run `npm install`
1. Install Docker
2. Install Docker-Compose
3. Clone this repository
4. Run `docker-compose up`

Usage
=====

1. Ensure port 53, 80, and 8100 are open on the computer running pegaswitch.
2. Start pegaswitch with `sudo node start.js`
3. Configure your Switch DNS settings to point to the IP of your computer.
4. Run a connection test to trigger the Captive Portal. (Likewise, going into an update page will do the same.)
2. PegaSwitch will start automatically when you start the docker container.
3. To run PegaSwitch natively without a container install NodeJS and run `npm install`.
4. Configure your Switch DNS settings to point to the IP of your computer.
5. Run a connection test to trigger the Captive Portal. (Likewise, going into an update page will do the same.)

It should no longer be necessary to run `usefulscripts/SetupNew.js`, since PegaSwitch will now do it automatically.

Expand All @@ -37,6 +39,12 @@ To view locally: `npm run docs:serve` then visit `http://localhost:4001`

To generate to `docs` folder: `npm run docs:generate`

Why Docker?
===============

Docker allows the app to run in the same environment, regardless of what OS the host computer is running. This
simplifies development as well as reduces bugs and improves overall performance.

Troubleshooting
===============

Expand All @@ -60,7 +68,9 @@ ex:
C:\pegaswitch\> node start.js --logfile log.txt
```

If you encounter problems using pegaswitch on Windows, we suggest installing through WSL.
If you encounter problems using pegaswitch on Windows, we suggest using Docker.

NOTE: If running inside docker container inside Windows, this does not apply.

License
=======
Expand Down
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3'
services:
pegaswitch:
container_name: pegaswitch
build: .
# Uncomment only if you want to devleop on app locally and within container. If just running app no need to do anything. #
# volumes:
# - .:/opt/app
ports:
- 80:80
- 53:53
- 8100:8100
restart: always