Browse Source

add dummyservice

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

8
docker-compose.yml

@ -35,23 +35,19 @@ services:
networks: networks:
datacollector-net: datacollector-net:
readmongo: readmongo:
image: hub.swarmlab.io:5480/poc-datacollector-readmongo:latest
container_name: readmongo_service container_name: readmongo_service
restart: always restart: always
depends_on:
- writetomongo
logging: logging:
driver: "fluentd" driver: "fluentd"
options: options:
fluentd-async-connect: "true" fluentd-async-connect: "true"
tag: mongo.node2 tag: mongo.node2
build: ./readmongo #build: ./readmongo
image: readmongo:latest
ports: ports:
- "3000:3000" - "3000:3000"
# volumes: # volumes:
# - ./readmongo:/usr/src/app # - ./readmongo:/usr/src/app
links:
- mongo
networks: networks:
datacollector-net: datacollector-net:
dummy: dummy:

2
dummyservice/ecosystem.config.js → dummyservice/dummyservice.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/dummyservice/swarmlab-app/src",
script: "run/app.js", script: "run/app.js",
run_as_user: "node", run_as_user: "node",
args: "start", args: "start",

15
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

8
dummyservice/start-server.sh

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