Commit 86f5d964 authored by Yuci Gou's avatar Yuci Gou

#487 Manage PubSweet server using pm2

parent e9371474
......@@ -25,6 +25,9 @@ ENV NODE_ENV "development"
RUN npm install -g node-pre-gyp
# Install pm2
RUN [ "yarn", "global", "add", "pm2" ]
# We do a development install because react-styleguidist is a dev dependency and we want to run tests
RUN [ "yarn", "install" ]
......
const pm2Config = {
apps: [
{
name: 'pubsweet',
script: './node_modules/pubsweet/src/startup/start.js',
exec_mode: 'cluster_mode',
instances: 1,
},
{
name: 'ftpBulkMonitor',
script: 'server/ftp-integration/api',
instances: 1,
},
{
name: 'ftpTaggerMonitor',
script: 'server/ftp-integration/taggedXML',
instances: 1,
},
],
}
module.exports = pm2Config
......@@ -4,10 +4,10 @@ echo "Running cron service"
service cron start
echo "Running ftp bulk upload monitor"
./runShellScript.sh "node server/ftp-integration/api" &
pm2 start ftpBulkMonitor
echo "Running ftp taggers upload monitor"
./runShellScript.sh "node server/ftp-integration/taggedXML" &
pm2 start ftpTaggerMonitor
echo "Running Seed"
yarn seed
......
#!/bin/bash
echo "Running server in the background"
cmd="npx pubsweet server"
cmd="pm2 start pubsweet"
$cmd &
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment