|
2 | 2 |
|
3 | 3 | Here you find how to deploy your application to a Server.
|
4 | 4 |
|
| 5 | + |
| 6 | +## Heroku |
| 7 | + |
| 8 | +1. Set up botpress locally with all the dependent modules installed and configured |
| 9 | + * (if using messenger module) make sure you disable Ngork before uploading to heroku |
| 10 | + |
| 11 | +2. You need a [free Heroku account](https://signup.heroku.com/dc) and [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) installed |
| 12 | + |
| 13 | +3. Check package.json to be sure all dependencies are included |
| 14 | + 1. you can add custom dependencies using `npm install <pkg> --save` |
| 15 | + 2. Add node version to `packages.json` |
| 16 | + ```javascript |
| 17 | + "engines": { |
| 18 | + "node": "7.1.0" |
| 19 | + }, |
| 20 | + ``` |
| 21 | + |
| 22 | +4. Specifying a start script [Procfile](https://devcenter.heroku.com/articles/procfile) or make sure you have the start script in your packages.json |
| 23 | + |
| 24 | + |
| 25 | +So your final package.json should look something like this: |
| 26 | +```javascript |
| 27 | +{ |
| 28 | + "name": "AwsomeBot", |
| 29 | + "version": "0.0.1", |
| 30 | + "description": "botishness", |
| 31 | + "main": "index.js", |
| 32 | + "dependencies": { |
| 33 | + "botpress": "0.x", |
| 34 | + "botpress-analytics": "^1.0.7", |
| 35 | + "botpress-hitl": "0.0.1", |
| 36 | + "botpress-messenger": "^1.0.16", |
| 37 | + "botpress-scheduler": "^1.0.1", |
| 38 | + "botpress-subscription": "^1.0.2" |
| 39 | + }, |
| 40 | + "scripts": { |
| 41 | + "start": "botpress start", |
| 42 | + "test": "echo \"Error: no test specified\" && exit 1" |
| 43 | + }, |
| 44 | + "author": "sbeta", |
| 45 | + "license": "AGPL-3.0", |
| 46 | + "engines": { |
| 47 | + "node": ">6.0.0" |
| 48 | + } |
| 49 | +} |
| 50 | + |
| 51 | +``` |
| 52 | + |
| 53 | + |
| 54 | +5. Try it locally and see if it works: `heroku local web` |
| 55 | + |
| 56 | +6. Go to Heroku dashboard and make a new app and from there you can follow the instruction to get botpress on heruko `Deploy using Heroku Git` |
| 57 | + |
| 58 | +7. Go to Heroku dashboard -> Settings and in the Config Variables section add a password for your dashboard: |
| 59 | +``` |
| 60 | +BOTPRESS_PASSWORD : <YOUR_ST0nG_PasSwoRd> |
| 61 | +``` |
| 62 | + |
| 63 | +---------------------------------------------------------------------------------------------- |
| 64 | + |
5 | 65 | ## Amazon AWS (EC2)
|
6 | 66 |
|
7 | 67 | #### 1 - First you need to have a custom domain name bought (can be bought in AWS)
|
@@ -75,18 +135,18 @@ Obs2: If you use windows [Git Bash (Distributed with Git for Windows)](https://g
|
75 | 135 |
|
76 | 136 | 7.2 - Next you need to compile some source files
|
77 | 137 |
|
78 |
| -```sudo apt-get install build-essential``` |
| 138 | +```sudo apt-get install build-essential``` |
79 | 139 |
|
80 | 140 | 7.3 - You can run ```npm --version``` and ```node --version``` to check if instalation is ok.
|
81 | 141 |
|
82 | 142 | #### 8 - [Install pm2 to manage process](https://github.com/Unitech/pm2)
|
83 | 143 |
|
84 |
| -```npm install -g pm2`` |
| 144 | +```npm install -g pm2`` |
85 | 145 |
|
86 | 146 | #### 9 - [Setup Nginx and pm2](https://doesnotscale.com/deploying-node-js-with-pm2-and-nginx/)
|
87 | 147 |
|
88 | 148 | #### 10 - Clone your project inside some server folder (i like to put into /var/app/myapp)
|
89 | 149 |
|
90 | 150 | 9.1 - Go to your app folder and run ```npm install```
|
91 | 151 |
|
92 |
| -9.2 - Put your app into production! ```pm2 start npm -- start``` that's all folks! |
| 152 | +9.2 - Put your app into production! ```pm2 start npm -- start``` that's all folks! |
0 commit comments