Skip to content

Commit

Permalink
chore: setup deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
mistakia committed Jan 16, 2025
1 parent c4b1221 commit 17de6a9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 23 deletions.
22 changes: 0 additions & 22 deletions ecosystem.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"start": "NODE_ENV=development node server",
"lint": "eslint . --ext js,mjs",
"prettier": "prettier --write .",
"test": "TZ=America/New_York NODE_ENV=test TEST=all mocha --exit"
"test": "TZ=America/New_York NODE_ENV=test TEST=all mocha --exit",
"deploy": "pm2 deploy server.pm2.config.js production"
},
"dependencies": {
"bignumber.js": "^9.0.1",
Expand Down
37 changes: 37 additions & 0 deletions server.pm2.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
apps: [
{
name: 'nanodb-api',
script: 'server.mjs',
watch: './api',
env_production: {
NODE_ENV: 'production'
},
max_memory_restart: '2G'
},
{
name: 'nanodb-sync-websocket',
script: 'scripts/import-websocket.mjs',
watch: '.',
env_production: {
NODE_ENV: 'production'
},
max_memory_restart: '2G'
}
],

deploy: {
production: {
user: 'root',
host: 'storage',
ref: 'origin/master',
repo: 'https://github.com/mistakia/nanodb.git',
path: '/root/league',
'pre-deploy': 'git pull',
'pre-deploy-local': '',
'post-deploy':
'source ~/.bash_profile && /home/user/.nvm/versions/node/v16.4.0/bin/yarn install && pm2 reload server.pm2.config.js --env production',
'pre-setup': ''
}
}
}

0 comments on commit 17de6a9

Please sign in to comment.