From 4c6ea69f2dd2ff149c9532399b52948f35e8cb7a Mon Sep 17 00:00:00 2001 From: RajathUbuntu Date: Thu, 4 Mar 2021 08:19:11 -0500 Subject: [PATCH] Modified dockerfile to make sure process does not exit, updated run with start script and updated README with steps to run --- scripts/portalDocker/Dockerfile | 1 - scripts/portalDocker/README.md | 19 +++++++++++++------ scripts/portalDocker/run.sh | 5 ++++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/scripts/portalDocker/Dockerfile b/scripts/portalDocker/Dockerfile index a5a44da..94a2b70 100644 --- a/scripts/portalDocker/Dockerfile +++ b/scripts/portalDocker/Dockerfile @@ -8,6 +8,5 @@ RUN git clone https://github.com/EdgeVPNio/portal.git WORKDIR "/portal" RUN npm install --legacy-peer-deps RUN npm run build -EXPOSE 5000 COPY ./run.sh . CMD ./run.sh \ No newline at end of file diff --git a/scripts/portalDocker/README.md b/scripts/portalDocker/README.md index 494c167..8af571a 100644 --- a/scripts/portalDocker/README.md +++ b/scripts/portalDocker/README.md @@ -3,25 +3,32 @@ - Run the below command to start the mongo DB docker. ``` - docker run -d -p 27017-27019:27017-27019 --network dkrnet --name mongodb mongo + docker run -d -p 27017-27019:27017-27019 --network evionet --rm --name mongodb mongo mongod --replSet Evio-rs0 ``` -- Create a directory inside the evio directory situated in the HOME directory. +- Run the below command from the host shell: + + ``` + mongo Evio --eval "rs.initiate()" + ``` + +- Create a directory on the host to be mounted in the container's filesystem, eg. ~/evio/portal ``` mkdir portal && cd portal ``` -- Copy the .env file from [.env](https://github.com/EdgeVPNio/portal/blob/master/.env) into the portal directory. +- Copy the configuration file from [.env](https://github.com/EdgeVPNio/portal/blob/master/.env) into the portal directory. -- Replace the `DB_URI` with the name of the MongoDB container you gave in the first command. +- Replace the value of the key `DB_URI` with the name of the mongo container ``` - DB_URI= + DB_URI=mongodb ``` - Run the below command to start the portal container + The port number can be changed at your convenience. ``` - docker run -d -p 5000:5000 --name Evioportal -v $HOME/evio/portal/.env:/etc/evio/config/.env --privileged --network dkrnet edgevpnio/evio-portal:0.1 + docker run -d -p 5000:5000 --name visualizer -v $HOME/evio/config/.env:/etc/evio/config/.env --rm --privileged --network evionet edgevpnio/evio-portal:0.1 ``` diff --git a/scripts/portalDocker/run.sh b/scripts/portalDocker/run.sh index d3d89fb..b9ba19d 100755 --- a/scripts/portalDocker/run.sh +++ b/scripts/portalDocker/run.sh @@ -1,3 +1,6 @@ #!/bin/bash cp -r /etc/evio/config/.env . -node server/Server.js \ No newline at end of file +./startVisualizer.sh start +while :; do + sleep 300 +done \ No newline at end of file