简体   繁体   English

更改 Jelastic Node.js 根文件夹

[英]Changing Jelastic Node.js root folder

I am trying to deploy a React app in my Jelastic Node.js server but I am not being able to make it work.我正在尝试在我的 Jelastic Node.js 服务器中部署一个 React 应用程序,但我无法使其工作。

I am using vite for building.我正在使用 vite 进行构建。 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.为了测试部署,我在本地环境中构建我的应用程序并将构建目录部署到 Node.js 服务器中,该服务器有时可以正常工作,但有时也无法正常工作,并且该站点无法访问。 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.但是我想让这个过程自动化,并将根目录设置为dist目录,这是 vite 的默认构建目录,以便我可以从 GitHub 中提取它并运行构建命令并自动部署它。 I searched for changing the configurations in Jelastic Node.js but couldn't find any relating to this issue.我搜索了更改 Jelastic Node.js 中的配置,但找不到与此问题相关的任何内容。

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).您可以 a) 将 VCS 项目添加到任何ROOT上下文中,并为 ROOT 创建一个通过 WebSSH 的符号链接(但这可能会导致部署期间停机)或 b) 将 VCS 项目添加到任何ROOT上下文中并添加一个部署挂钩,其中副本从dist到 ROOT 的内容(在这种情况下,停机时间最小化)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM