diff --git a/http-test-server/README.md b/http-test-server/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/http-test-server/server.js b/http-test-server/server.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/install.sh b/install.sh index 45281a737d..6744864310 100644 --- a/install.sh +++ b/install.sh @@ -1,3 +1,5 @@ +USER=$whoami + if [[ ! $(which docker) && ! $(docker --version) ]] then echo -e "\033[91mPlease install Docker. https://docs.docker.com/install" @@ -22,36 +24,45 @@ then exit fi -cd accounts -npm ci -cd .. +sudo docker stop $(sudo docker ps -aq) || echo 'No docker containers' +sudo docker rm $(sudo docker ps -aq) || echo 'No docker containers' -cd api-docs -npm ci -cd .. +sudo mkdir /Users/$USER/mongodb || echo 'Path already exists' -cd backend -npm ci -cd .. - -cd dashboard -npm ci -cd .. - -cd home -npm ci -cd .. - -cd status-page -npm ci -cd .. - -cd probe -npm ci -cd .. +# Run Dependencies +sudo docker run --name mongo -v /Users/$USER/mongodb -p 27017:27017 -d mongo:3.4 +sudo docker run --name redis -p 6379:6379 -d redis redis-server +# Run Backend +sudo docker build -t fyipe-project/backend:latest ./backend +sudo docker run --net=host --env-file ./backend/.env.development -d fyipe-project/backend:latest #port is not needed because of nethost +# Run Accounts +sudo docker build -t fyipe-project/accounts:latest ./accounts +sudo docker run -p 3003:3003 -d fyipe-project/accounts:latest +#Run Dashboard +sudo docker build -t fyipe-project/dashboard:latest ./dashboard +sudo docker run -p 3000:3000 -d fyipe-project/dashboard:latest +# Run home +sudo docker build -t fyipe-project/home:latest ./home +sudo docker run -p 1444:1444 -d fyipe-project/home:latest + +# Run Status Page +sudo docker build -t fyipe-project/status-page:latest ./status-page +sudo docker run -p 3006:3006 -d fyipe-project/status-page:latest + +# Run Admin Dashboard +sudo docker build -t fyipe-project/admin-dashboard:latest ./admin-dashboard +sudo docker run -p 3100:3100 -d fyipe-project/admin-dashboard:latest + +# Run Probes 1 +sudo docker build -t fyipe-project/probe:latest ./probe +sudo docker run -p 3009:3009 -e "SERVER_URL=http://localhost:3002" -e "PROBE_NAME=EU" -e "PROBE_KEY=13b674ca-9fdd-11e9-a2a3-2a2ae2dbcce4" -d fyipe-project/probe:latest + +# Run Probes 2 +sudo docker build -t fyipe-project/probe:latest ./probe +sudo docker run -p 3009:3009 -e "SERVER_URL=http://localhost:3002" -e "PROBE_NAME=US" -e "PROBE_KEY=33b674ca-9fdd-11e9-a2a3-2a2ae2dbcce4" -d fyipe-project/probe:latest diff --git a/uninstall.sh b/uninstall.sh new file mode 100644 index 0000000000..cb8eddf481 --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,2 @@ +sudo docker stop $(sudo docker ps -aq) || echo 'No docker containers' +sudo docker rm $(sudo docker ps -aq) || echo 'No docker containers' \ No newline at end of file