Dennis

Dennis

Planned

I need to test whether it's easy in Ploi to host Next JS and/or Nuxt JS projects easily.

seitenumbruch

seitenumbruch

· ·

Not sure if this is useful or not... But I am currently working with Nuxt JS (v2) and I don't find it particularly difficult to host Nuxt projects (using SSR) using Ploi. This is what I do:

(1) Create a new site with project type "None" and web directory "/".

(2) Alter deploy code like so:

cd /home/someuser/project.com
git pull origin master

npm i
npm run build

echo "🚀 Application deployed!"

(3) Alter Nginx config according/similar to NuxtJS Nginx example for Laravel Forge.

(4) In /home/someuser/ create file ecosystem.config.js:

module.exports = {
  apps: [
    {
      name: "project.com",
      exec_mode: "cluster",
      instances: "max",
      cwd: "./project.com",
      script: "./node_modules/nuxt/bin/nuxt.js",
      args: "start",
      env: {
        PORT: 3000,
      },
    },
  ],
}

(5) Deploy.

(6) SSH into server and run pm2 start ecosystem.config.js.

(7) In deploy code add pm2 reload "project.com":

cd /home/someuser/project.com
git pull origin master

npm i
npm run build
pm2 reload "project.com" # <-- this

echo "🚀 Application deployed!"

I am not sure if this is a good way to go about things... but it works for me.

You may use @ to mention someone.

Test: Next JS & Nuxt JS hosting

5 total votes
Geeks One Dennis Lizarzaburu rognales Azurite Solutions Dennis
  • Dennis moved item to board Planned

    2 months ago
  • Dennis moved item to project Site Level Requests

    2 months ago
  • Dennis created the item

    2 months ago