1

I am trying to deploy a React app in my Jelastic Node.js server but I am not being able to make it work.

I am using vite for building. To test the deployment, I am building my app on my local environment and deploying the build directory into the Node.js server which works fine sometimes but sometimes it too doesn't work and the site is unreachable. I don't know what causes this.

But I want to make this process automatic and set the root directory to dist directory which is default build directory for vite so that I could pull it from GitHub and run build command and deploy it automatically. I searched for changing the configurations in Jelastic Node.js but couldn't find any relating to this issue.

iamsubingyawali
  • 193
  • 1
  • 2
  • 15
  • 1
    I'm looking for the same thing... not really friendly to setup, doc is poor. Any update on this? – Bogy Sep 03 '22 at 16:40
  • There might be other ways, but I came with my own workaround to solve this. I hosted my app on an Apache server and ran a post deployment hook which runs 1. dependency install command 2. production build command, 3. copies files from build directory, 4. moves to document root and 5. deletes the production build directory. – iamsubingyawali Sep 03 '22 at 17:21

1 Answers1

0

You can either a) add VCS project into any non ROOT context, and for ROOT create a symlink through WebSSH (but this can cause downtime during deployment) or b) add VCS project into any non ROOT context and add a deployment hook to which copy content from dist into ROOT (and in this case downtime is minimized).

Virtuozzo
  • 1,993
  • 1
  • 10
  • 13