0

its the first time i use Jelastic and i need to deploy a vuejs app from git.

I've make a Nodejs env and deploy my vuejs app. Then, i run:

cd ROOT
npm install
npm run build

And i get an successfully message: Build complete. The dist directory is ready to be deployed.

So, what i usually do next in localhost is something like this:

cd dist
npm http-server

But in Jelastic i don't really know whats next after the build. I've try to go into http://node-env.route/dist but i get a 502 error page (The opened link forwards to the environment where the application server is down or is not picked up yet.)

Hope you can help me, thank you!

Virtuozzo
  • 1,993
  • 1
  • 10
  • 13
Ken Ramirez
  • 325
  • 5
  • 17
  • It is too few details about your project for a specific answer. Please, look at simple vue pizza application found at GitHub(https://github.com/prograhammer/vue-pizza) as example and compare with your configs. If project configured well, it can be deployed just by clicking a button "Deploy" without any additional actions as shown in the deployment guide (https://docs.jelastic.com/deployment-guide) . – Virtuozzo Feb 28 '19 at 09:36
  • @Jelastic you were right, i can deploy correctly vue-pizza. I'm actually using https://github.com/creativetimofficial/vue-argon-design-system. I'm missing something and i don't know what is. – Ken Ramirez Mar 01 '19 at 20:42
  • Investigation shows some problems in the above project. At least, there is an incorrect import of register-service-worker and a problem with the configuration of WebPack to work with a proxy server (https://github.com/rails/webpacker/issues/424). – Virtuozzo Mar 04 '19 at 16:37

1 Answers1

0

In order to run your application I suggest you to install pm2 on your server and run this command:

pm2 start npm --name "your-app-alias" -- start

After re-build you need to restart:

pm2 restart your-app-alias

Maybe after that you need a reverse proxy with NGINX to link your nodejs env to your localhost. Something like that:

server {
    listen          80;        # the port nginx is listening on
    server_name     YOUR-JELASTIC-ENV-URL;    # setup your domain here

    location / {
        expires $expires;

        proxy_redirect                      off;
        proxy_set_header Host               $host;
        proxy_set_header X-Real-IP          $remote_addr;
        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto  $scheme;
        proxy_read_timeout          1m;
        proxy_connect_timeout       1m;
        proxy_pass                          http://127.0.0.1:3000; # set the adress of the Node.js instance here
    }
}