Quellcode durchsuchen

add pm2 configuration

Olivier Massot vor 4 Jahren
Ursprung
Commit
d86da406a8
2 geänderte Dateien mit 32 neuen und 0 gelöschten Zeilen
  1. 19 0
      README.md
  2. 13 0
      ecosystem.config.js

+ 19 - 0
README.md

@@ -37,6 +37,25 @@ $ yarn docs
 
 For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org).
 
+## Déployer comme un service
+
+> Prérequis : PM2 doit être installé de manière globale (https://nuxtjs.org/deployments/pm2/)
+
+Pour déployer le projet en mode SSR :
+
+    yarn build
+    pm2 start
+
+Vérifier le statut avec :
+ 
+    pm2 show app
+
+On pourra ensuite interagir avec le service ainsi :
+
+    pm2 restart app
+    pm2 stop app
+    pm2 logs app
+
 ## Structure du projet
 
 | Répertoire | Rôle |

+ 13 - 0
ecosystem.config.js

@@ -0,0 +1,13 @@
+// PM2 configuration: https://nuxtjs.org/deployments/pm2/
+
+module.exports = {
+  apps: [
+    {
+      name: 'app',
+      exec_mode: 'cluster',
+      instances: '1',
+      script: './node_modules/nuxt/bin/nuxt.js',
+      args: 'start --hostname \'0.0.0.0\' --port 3002'
+    }
+  ]
+}