diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f6d0034 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +# Author: Kunush +FROM node:13.5.0-alpine3.10 +# copy the local folder to the image +COPY websheep /websheep +# run build +RUN cd /websheep && yarn install +# change to websheep directory +WORKDIR /websheep +# expose websheep ports [3333: web service, 4200: web interface, 7777: debugging ws] +EXPOSE 4200 +EXPOSE 3333 +EXPOSE 7777 +ENTRYPOINT ["yarn", "start"] diff --git a/README.md b/README.md index 72a8387..6b16cc6 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,24 @@ Install [Node](https://nodejs.org/en/download/) & [Yarn](https://classic.yarnpkg yarn install yarn start ``` +# Running websheeb using docker + +1. Download the repository as a zip file +2. Unzip to a folder and rename it to websheep +3. Copy the Dockerfile outside websheep so your directory structure will look like +``` +$ ls -l +total 8 +-rw-r--r-- 1 kali kali 177 Oct 19 09:55 Dockerfile +drwxr-xr-x 8 kali kali 4096 Oct 19 09:48 websheep +``` +4. Building a docker image +``` +sudo docker build -t mysheep . +``` +5. Upon successful image build run the container +``` +sudo docker run --rm -d --name sheep_container -p 4200:4200 -p 3333:3333 mysheep +``` +6. Open your browser and navigate to localhost:4200 for the web interface or localhost:3333 for the api testing interface. + diff --git a/package.json b/package.json index 536f083..d31c602 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "nx": "nx", "postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points", "start": "run-p start:*", - "start:websheep": "ng serve websheep", - "start:websheep-api": "ng serve websheep-api", + "start:websheep": "ng serve websheep --host 0.0.0.0", + "start:websheep-api": "ng serve websheep-api --host 0.0.0.0", "build": "yarn run build:websheep-api:prod", "build:websheep": "ng build websheep", "build:websheep:prod": "ng build websheep --prod",