Add new setup command and deployment section in the documentation

This commit is contained in:
Aurelsicoko 2017-12-20 17:20:44 +01:00
parent 34763b0237
commit 3c7efa07f8
3 changed files with 48 additions and 0 deletions

View File

@ -28,6 +28,7 @@
* [Routing](guides/routing.md)
* [Services](guides/services.md)
* [Authentification](guides/authentification.md)
* [Deployment](guides/authentification.md)
### Plugins
* [Quick start](plugins/quick-start.md)

View File

@ -0,0 +1,46 @@
# Deployment
#### #1 - Configurate
Update the `production` settings with the IP and domain name where the project will be running.
**Path —** `./config/environments/production/server.json`.
```js
{
"host": "domain.io", // IP or domain
"port": 1337,
"autoReload": {
"enabled": false
},
"admin": {
"build": {
"path": "/dashboard" // We highly recommend to change the default `/admin` path for security reasons.
}
}
}
```
#### #2 - Setup
Run this following command to install the dependencies and build the project.
```bash
cd /path/to/the/project
npm run setup
```
> Note: The `build` folders are ignored (.gitignore). If you're cloning your git repository on your server, you need to run this command on your server.
#### #3 - Launch the server
Run the server with the `production` settings.
```bash
NODE_ENV=production npm start
```
> We highly recommend to use [pm2](https://github.com/Unitech/pm2/) to manage your process.
### Advanced configurations
If you want to host the administration on another server than the API, [please take a look at this dedicated section](advanced/customize-admin.md#deployment).

View File

@ -24,6 +24,7 @@ module.exports = scope => {
'description': 'A Strapi application.',
'main': './server.js',
'scripts': {
'setup': 'npm install && cd admin && npm run setup' // Ready to deploy setup
'start': 'node server.js',
'strapi': 'node_modules/strapi/bin/strapi.js', // Allow to use `npm run strapi` CLI,
'lint': 'node_modules/.bin/eslint api/**/*.js config/**/*.js plugins/**/*.js',