Browse Source

edit readmongo

master
zeus 3 years ago
parent
commit
6c793581ca
  1. 4
      docker-compose.yml
  2. 15
      readmongo/install-readmongo.sh
  3. 2
      readmongo/readmongo.config.js
  4. 8
      readmongo/start-server.sh

4
docker-compose.yml

@ -23,10 +23,10 @@ services:
networks: networks:
datacollector-net: datacollector-net:
writetomongo: writetomongo:
image: writemongo:latest image: hub.swarmlab.io:5480/poc-datacollector-fluent:latest
container_name: fluentd container_name: fluentd
user: root user: root
build: ./WriteToMongo/fluent #build: ./WriteToMongo/fluent
# volumes: # volumes:
# - ./WriteToMongo/fluent:/fluentd/etc # - ./WriteToMongo/fluent:/fluentd/etc
ports: ports:

15
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

2
readmongo/ecosystem.config.js → readmongo/readmongo.config.js

@ -5,7 +5,7 @@ module.exports = {
autorestart: true, autorestart: true,
watch: true, watch: true,
//"script" : "/home/node/swarmlab-app/run/app.js", //"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", script: "run/app.js",
run_as_user: "node", run_as_user: "node",
args: "start", args: "start",

8
readmongo/start-server.sh

@ -0,0 +1,8 @@
#!/bin/sh
BASEDIR=$(dirname $0)
cd $BASEDIR
pm2-runtime readmongo.config.js
Loading…
Cancel
Save