在 Ubuntu 服务器(阿里巴巴 ECS)上部署 MERN 堆栈 Web 应用



我正在使用MongoDB,ExpressJS,ReactJS(create-react-app(和NodeJS构建一个Web应用程序。我已经完成了开发部分,现在我想将此 Web 应用程序部署到 Ubuntu 服务器。

我的文件结构如下所示 点击查看图片

package.json (服务器(

{
"name": "pair-programming",
"version": "1.0.0",
"description": "pair-programming web app for codechef's hackathon",
"main": "server.js",
"scripts": {
"client-install": "npm install --prefix client",
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix client",
"dev": "concurrently "npm run server" "npm run client"",
"serve-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
},
"author": "Parmeet Singh",
"license": "ISC",
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.3",
"concurrently": "^4.0.1",
"express": "^4.16.3",
"jsonwebtoken": "^8.3.0",
"mongodb": "^3.1.6",
"mongoose": "^5.2.13",
"node-uuid": "^1.4.8",
"nodemailer": "^4.6.8",
"passport": "^0.4.0",
"passport-jwt": "^4.0.0",
"request": "^2.88.0",
"sprintf-js": "^1.1.1",
"validator": "^10.7.1"
},
"devDependencies": {
"nodemon": "^1.18.4"
}
}

package.json (react(

{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"classnames": "^2.2.6",
"jwt-decode": "^2.2.0",
"react": "^16.5.1",
"react-dom": "^16.5.1",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.5",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"proxy": "http://0.0.0.0:5000"
}

因此,如果可能的话,请帮助我将这个网络应用程序部署到 ubuntu 服务器。我以前没有在 ubuntu 上部署过。

这很简单,您需要运行几个命令来成功部署服务器和反应代码,

假设您没有安装任何 GUI,我们必须使用称为screen

  1. 通过 putty/类似程序 SSH 您的实例。[SSH root@

    相关内容

    • 没有找到相关文章

最新更新