markdown 用于AWS弹性beanstalk部署的后端服务器

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 用于AWS弹性beanstalk部署的后端服务器相关的知识,希望对你有一定的参考价值。

need 3 servers
- frontend : react
- backend : express node
- prisma

here backend server deploying with `AWS elastic beanstalk` instruction

[official doc to follow](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs_express.html)

> Note: When babel compile is needed
[ref](https://www.notion.so/Before-Deploy-0b253e7e866c451497252925ebef12a5)

customization
---
package.json
```
  "scripts": {
    "start": "dotenv -- nodemon -e ts,graphql -x ts-node src/index.ts",
    "debug": "dotenv -- nodemon -e ts,graphql -x ts-node --inspect src/index.ts",
    "build": "rimraf dist && tsc",
\!h     "serve": "node dist/index.js"
  },
```
Note that correct path is need like `dist/index.js` 

---
.ebextensions/nodecommand.config
```
option_settings:
  aws:elasticbeanstalk:container:nodejs:
\!h     NodeCommand: "npm run-script serve"
```
it runs `serve` command

---
1. git commit(eb works with git committed files)
2. `yarn build` to make `dist` folder
3. `eb deploy`
4. check [console](https://ap-northeast-2.console.aws.amazon.com/elasticbeanstalk/) for **status** or **logs**

以上是关于markdown 用于AWS弹性beanstalk部署的后端服务器的主要内容,如果未能解决你的问题,请参考以下文章

408 HTTP 错误尝试使用负载均衡器访问 AWS 弹性 beanstalk 上的 https

无法将数据库迁移到 AWS 弹性 Beanstalk

防止使用 AWS 账户下载弹性 beanstalk 应用程序?

如何使用 AWS CLI 更新弹性 beanstalk 代码?

AWS Cloudformation:如何在 AWS 弹性 beanstalk 配置中引用多个安全组

AWS:将子域指向不同的弹性 beanstalk 环境