leomurca/ecosystem.config.cjs

39 lines
967 B
JavaScript

module.exports = {
apps: [
{
name: 'leomurca-prod',
script: './build/index.js',
time: true,
instances: 1,
autorestart: true,
max_restarts: 50,
watch: false,
max_memory_restart: '1G',
env: {
PUBLIC_APP_ENV: 'production',
NODE_ENV: 'production',
PORT: 7296,
},
},
],
deploy: {
production: {
user: 'deployer',
host: '45.76.5.44',
key: 'deploy.key',
ref: 'origin/master',
repo: 'git@git.leomurca.xyz:leomurca/leomurca.git',
path: '/home/deployer/prod-leomurca',
'pre-deploy':
'rm -rf node_modules build .svelte-kit && npm ci && PUBLIC_APP_ENV=production npm run build',
'post-deploy':
'pm2 startOrReload ecosystem.config.cjs --only leomurca-prod --env production && pm2 save',
env: {
PUBLIC_APP_ENV: 'production',
NODE_ENV: 'production',
PORT: 7296,
},
},
},
};