Open anselmo-coolstay opened 2 years ago
The port is typically specified as an environment variable. Try the following ecosystem.config.js
module.exports = {
apps: [{
name: "app",
script: "./app.js",
env_staging: {
NODE_ENV: "staging",
PORT: 3030,
},
}],
deploy: {
staging: {
user: 'deployer',
host: 'localhost',
ref: 'origin/staging',
repo: 'git@github.com:xxxxxx/yyyyyy',
path: '/home/deployer/yyyyyy',
'pre-deploy-local': '',
'post-deploy': '. ~/.profile && yarn install && pm2 reload scripts/pm2/ecosystem.config.js --env staging',
'pre-setup': '',
},
}
}
What's going wrong?
I should deploy my app thru ssh tunneling, so that it should be deployed to localhost. However, localhost causes deploy failure. 127.0.0.1 works well instead of localhost.
And pm2 document does not mention port for deploy target config.
port
property of deploy config works, but it should be a string, not a number.How could we reproduce this issue?
Supporting information