UNPKG

4.02 kBMarkdownView Raw
1<!--
2 This file was generated by emdaer
3
4 Its template can be found at .emdaer/docs/install.emdaer.md
5-->
6
7<!--
8 emdaerHash:1e0b0f7bb25c2974949a984f1639ecb0
9-->
10
11<h1 id="installation-img-align-right-src-logo-svg-alt-contenta-logo-title-contenta-logo-width-100-">Installation <img align="right" src="../logo.svg" alt="Contenta logo" title="Contenta logo" width="100"></h1>
12<p>In order to install ContentaJS you will need to meet the following requirements:</p>
13<ul>
14<li><code>nodejs</code> ^8.11.1 or higher.</li>
15<li>A working installation of <a href="https://github.com/contentacms/contenta_jsonapi">Contenta CMS</a>.</li>
16<li>A Redis server (optional). Use the
17<a href="https://github.com/contentacms/contentajsRedis">@contentacms/redis</a> module
18to leverage the Redis cache back-end.</li>
19</ul>
20<h2 id="local-installation">Local Installation</h2>
21<h3 id="install-contenta-cms">Install Contenta CMS</h3>
22<p>Install Contenta CMS using <a href="http://www.contentacms.org/#install">the instructions</a>.</p>
23<p>Take note of the installation URL. For instance <code>http://localhost:8888</code>.</p>
24<h3 id="install-contentajs">Install ContentaJS</h3>
25<p>Install the starter kit by using downloading <a href="https://github.com/contentacms/contentajs/archive/master.tar.gz">the
26package</a> and
27extracting it. In MacOS and Linux you can do:</p>
28<pre><code>
29curl -Lo contenta.tar.gz https://github.com/contentacms/contentajs/archive/master.tar.gz
30tar -xzf contenta.tar.gz
31mv contenta-master YOUR_PROJECT_NAME
32cd YOUR_PROJECT_NAME
33npm install
34git init && git add . && git ci -m 'feat: project initialization with Contenta JS'
35</code></pre>
36<h3 id="configure">Configure</h3>
37<p>Create a local configuration file. This configuration file will contain all the
38configuration that <strong>only</strong> applies to the local development box. This file
39should not be checked into the repository.</p>
40<pre><code>
41touch config/local.yml
42</code></pre>
43<p>Add the URL where ContentaJS will find your Contenta CMS (Drupal) installation.
44You can also add the URL of the node.js instance for CORS whitelisting if you
45need to have CORS support. For instance:</p>
46
47```yaml
48cms:
49 host: http://localhost:8888
50
51cors:
52 origin:
53 # It's OK to use '*' in local development.
54 - '*'
55```
56<p>It is important to note that you can override configuration per environment.
57That means that your <code>config/staging.yml</code> may contain:</p>
58
59```yaml
60cms:
61 host: http://stg.example.com
62```
63<p>Learn more about configuration in the
64<a href="https://www.npmjs.com/package/config">config module’s documentation</a>.</p>
65<h3 id="start-your-server">Start your server</h3>
66<p>Start your server with multiple threads serving requests (one per CPU core).
67This uses the <a href="https://pm2.io/doc/en/runtime/overview/">PM2</a> module. Edit the
68<a href="./ecosystem.config.js"><code>ecosystem.config.js</code></a> file to tune how to start your
69app. Read
70<a href="https://pm2.io/doc/en/runtime/reference/ecosystem-file/">the documentation</a> for
71the PM2 ecosystem file.</p>
72<pre><code>
73npm start
74</code></pre>
75<p>Inspect the <code>&quot;scripts&quot;</code> section in the <a href="./package.json"><code>package.json</code></a> to find
76other useful scripts like <code>npm run debug</code>, <code>npm run stop</code> and <code>npm run test</code>.</p>
77<h3 id="-optional-install-the-redis-server">(Optional) Install the redis server</h3>
78<p>Optionally you can install the Redis server by doing <code>gem install redis</code> then
79follow the setup in <a href="https://github.com/contentacms/contentajsRedis#readme"><code>@contentacms/redis</code></a>.</p>
80<h2 id="aws-installation">AWS Installation</h2>
81<p><em>Fill in the instructions on how to install in AWS with ElastiCache using CloudFormation or a custom AMI</em></p>
82<h2 id="install-using-docker">Install Using Docker</h2>
83<p><em>Fill in the instructions on how to install using Docker.</em></p>
84<p><em>Ideally this installs Contenta CMS (Drupal), ContentaJS, and the Redis server.</em></p>