From 500296d4ce092abb23cd225d0dd349b3f17eae5b Mon Sep 17 00:00:00 2001 From: Kunush <3adel@protonmail.com> Date: Mon, 25 Mar 2024 22:06:53 +0300 Subject: [PATCH 1/2] Adding docker file: Dockerfile Runnig on 0.0.0.0 modifying package.json --- Dockerfile | 13 +++++++++++++ package.json | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 Dockerfile 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/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", From ee41412ae0d118495f257a9c5cd5e4d60118af13 Mon Sep 17 00:00:00 2001 From: Kunush <3adel@protonmail.com> Date: Mon, 25 Mar 2024 22:12:41 +0300 Subject: [PATCH 2/2] Adding more details to the README.md --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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. +