module.exports = {
apps : [{
//pm2名字
name: "nextcn",
//pm2運行腳本
script: "./app.js",
//環境變量
env: {
NODE_ENV: "development",
},
env_production: {
NODE_ENV: "production",
}
}],
deploy: {
// "production" is the environment name
production: {
// 服務器端SSH key 地址, 默認 $HOME/.ssh
key: "$HOME/.ssh",
// SSH user 需配置
user: "root",
// SSH host 需配置
host: ["47.98.138.195"],
// SSH options with no command-line flag, see 'man ssh'// can be either a single string or an array of strings
ssh_options: "StrictHostKeyChecking=no",
// GIT remote/branch
ref: "origin/master",
// GIT ssh遠程地址 需配置
repo: "git@github.com:raoenhui/next-site-cn.git",
// 放入服務器端地址 需配置
path: "/ice/pm2",
// Pre-setup command or path to a script on your local machine"pre-setup": "echo 'This is a pre-setup command'",
// Post-setup commands or path to a script on the host machine// eg: placing configurations in the shared dir etc"post-setup": "ls -la",
// pre-deploy action"pre-deploy-local": "echo 'This is a pre-deploy-local command'",
// post-deploy action"post-deploy": "npm install && pm2 reload ecosystem.config.js --env production'"
},
}
}
複製代碼