From 80637838bcc16d7f58aa44ca8e8c2e9b597cc5bc Mon Sep 17 00:00:00 2001 From: zeus Date: Sat, 20 Nov 2021 21:25:36 +0200 Subject: [PATCH] add dummyservice --- docker-compose.yml | 8 ++------ ...ecosystem.config.js => dummyservice.config.js} | 2 +- dummyservice/install-dummyservice.sh | 15 +++++++++++++++ dummyservice/start-server.sh | 8 ++++++++ 4 files changed, 26 insertions(+), 7 deletions(-) rename dummyservice/{ecosystem.config.js => dummyservice.config.js} (92%) create mode 100755 dummyservice/install-dummyservice.sh create mode 100755 dummyservice/start-server.sh diff --git a/docker-compose.yml b/docker-compose.yml index 48402c2..215f025 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,23 +35,19 @@ services: networks: datacollector-net: readmongo: + image: hub.swarmlab.io:5480/poc-datacollector-readmongo:latest container_name: readmongo_service restart: always - depends_on: - - writetomongo logging: driver: "fluentd" options: fluentd-async-connect: "true" tag: mongo.node2 - build: ./readmongo - image: readmongo:latest + #build: ./readmongo ports: - "3000:3000" # volumes: # - ./readmongo:/usr/src/app - links: - - mongo networks: datacollector-net: dummy: diff --git a/dummyservice/ecosystem.config.js b/dummyservice/dummyservice.config.js similarity index 92% rename from dummyservice/ecosystem.config.js rename to dummyservice/dummyservice.config.js index 678024d..aa3b670 100644 --- a/dummyservice/ecosystem.config.js +++ b/dummyservice/dummyservice.config.js @@ -5,7 +5,7 @@ module.exports = { autorestart: true, watch: true, //"script" : "/home/node/swarmlab-app/run/app.js", - cwd: "/usr/src/app/swarmlab-app/src", + cwd: "/home/node/dummyservice/swarmlab-app/src", script: "run/app.js", run_as_user: "node", args: "start", diff --git a/dummyservice/install-dummyservice.sh b/dummyservice/install-dummyservice.sh new file mode 100755 index 0000000..f7f80d5 --- /dev/null +++ b/dummyservice/install-dummyservice.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +BASEDIR=$(dirname $0) +cpwd=$PWD + +echo $BASEDIR + +cd $BASEDIR + +npm i +npm cache clean --force + +mkdir -p /home/node/run +mkdir -p /home/node/logs + diff --git a/dummyservice/start-server.sh b/dummyservice/start-server.sh new file mode 100755 index 0000000..c98afba --- /dev/null +++ b/dummyservice/start-server.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +BASEDIR=$(dirname $0) + +cd $BASEDIR + + +pm2-runtime dummyservice.config.js