diff --git a/package.json b/package.json index 8f3235a..4c6cfa3 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "start": "node ./dist/server.js", "build:client": "webpack --config ./webpack/.client.js --mode=production", "build:server": "webpack --config ./webpack/.server.js --mode=production", - "build": "yarn build:server && yarn build:client", + "build": "yarn build:server && yarn build:client && cp ./pm2.config.js ./dist/pm2.config.js", "watch": "webpack --config ./webpack/index.js --mode=development --watch", "lint": "eslint \"./**/*.{js,ts,tsx}\" --ignore-path .gitignore --fix", "format": "prettier --write \"src/**/*.{ts,tsx,json}\"" diff --git a/pm2.config.js b/pm2.config.js new file mode 100644 index 0000000..fd0f287 --- /dev/null +++ b/pm2.config.js @@ -0,0 +1,31 @@ +module.exports = { + apps: [ + { + /** + * General + */ + name: "dothree", + script: "./server.js", + max_memory_restart: "512M", + + /** + * Environment + */ + env_production: { + NODE_ENV: "production", + }, + env_development: { + NODE_ENV: "development", + }, + + /** + * Logs + */ + out_file: "./logs/stdout.log", + error_file: "./logs/error.log", + merge_logs: true, + log_date_format: "DD.MM.YYYY HH:mm:ss Z", + log_type: "json", + }, + ], +};