Skip to content
Snippets Groups Projects
Commit ebabeafa authored by Erkan Karabulut's avatar Erkan Karabulut
Browse files

run service_registry outside of docker

parent c281d529
No related branches found
No related tags found
No related merge requests found
FROM node:latest
WORKDIR /tmp/service_registry
COPY . /tmp/service_registry
RUN npm install
EXPOSE 8000
CMD npm start
......@@ -9,6 +9,8 @@ const express = require('express');
const app = express();
const fs = require('fs')
process.title = "registry"
/**
* A GET API that receive file names and returns the file content
*/
......
......@@ -4,15 +4,17 @@
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
"start": "node index.js &",
"stop": "pkill --signal SIGINT registry"
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.19.0",
"cookie-parser": "^1.4.5",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"dotenv": "^10.0.0"
"forever": "^4.0.3",
"npm-run-all": "^4.1.5"
}
}
......@@ -5,5 +5,4 @@
# @version 1.0
# stop service registry module
docker build . -t service_registry:1.0
docker run --name service_registry -d -p 8000:8000 --env-file=.env --restart=always -t service_registry:1.0
npm start
......@@ -5,10 +5,4 @@
# @version 1.0
# stop service registry module
# stop service_registry container if it is running
if [[ "$(docker ps -a --format "{{.Names}}" | grep service_registry)" == "service_registry" ]]; then
echo -e "$(date -u): Stopping service_registry container..."
docker stop service_registry &>/dev/null
docker rm -f service_registry &>/dev/null
echo -e "$(date -u): service_registry container is stopped."
fi
npm stop
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment