From 6c793581ca762e654c7e9713529ed24335ddfe34 Mon Sep 17 00:00:00 2001 From: zeus Date: Sat, 20 Nov 2021 21:08:31 +0200 Subject: [PATCH] edit readmongo --- docker-compose.yml | 4 ++-- readmongo/install-readmongo.sh | 15 +++++++++++++++ .../{ecosystem.config.js => readmongo.config.js} | 2 +- readmongo/start-server.sh | 8 ++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100755 readmongo/install-readmongo.sh rename readmongo/{ecosystem.config.js => readmongo.config.js} (93%) create mode 100755 readmongo/start-server.sh diff --git a/docker-compose.yml b/docker-compose.yml index 4e3475b..48402c2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,10 +23,10 @@ services: networks: datacollector-net: writetomongo: - image: writemongo:latest + image: hub.swarmlab.io:5480/poc-datacollector-fluent:latest container_name: fluentd user: root - build: ./WriteToMongo/fluent + #build: ./WriteToMongo/fluent # volumes: # - ./WriteToMongo/fluent:/fluentd/etc ports: diff --git a/readmongo/install-readmongo.sh b/readmongo/install-readmongo.sh new file mode 100755 index 0000000..f7f80d5 --- /dev/null +++ b/readmongo/install-readmongo.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/readmongo/ecosystem.config.js b/readmongo/readmongo.config.js similarity index 93% rename from readmongo/ecosystem.config.js rename to readmongo/readmongo.config.js index 7232c22..331c1ec 100644 --- a/readmongo/ecosystem.config.js +++ b/readmongo/readmongo.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/readmongo/swarmlab-app/src", script: "run/app.js", run_as_user: "node", args: "start", diff --git a/readmongo/start-server.sh b/readmongo/start-server.sh new file mode 100755 index 0000000..bb5032d --- /dev/null +++ b/readmongo/start-server.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +BASEDIR=$(dirname $0) + +cd $BASEDIR + + +pm2-runtime readmongo.config.js