Table of contents


On this page, we'll consider two ways you can get CodeX Docs running in production environment: using Docker (and docker-compose) and using Kubernetes.

Firstly, you need to create .codexdocsrc config file (feel free to change config if necessary):

cat <<EOT >> .codexdocsrc { "title": "CodeX Docs", "description": "A block-styled editor with clean JSON output", "menu": [ "Guides", {"title": "CodeX", "uri": ""} ], "startPage": "", "misprintsChatId": "12344564", "yandexMetrikaId": "", "carbon": { "serve": "", "placement": "" } } EOT

You also need production.json config with the following content (you can place it in ./config/ directory)

{ "port": 3000, "database": "/mnt/db", "rcFile": "./.codexdocsrc", "uploads": "/usr/src/app/public/uploads", "secret": "iamasecretstring", "favicon": "" }

Finally, you can create docker-compose.yml file and configure all the necessary volume mounts.

version: "3.2" services: docs: image: ports: - environment: - PASSWORD=codex volumes: - ./.codexdocsrc:/usr/src/app/.codexdocsrc:ro - ./config/production.json:/usr/src/app/config/production.json:ro - ./uploads:/usr/src/app/public/uploads - ./db:/mnt/db

To upgrade the version, run docker-compose pull

There is Helm chart, that you can use in order to install CodeX Docs to your Kubernetes cluster.

Firstly, you need to add to your helm repos:

helm repo add codex helm repo update

Then, you can download, review and change values for installing CodeX Docs chart:

helm show values codex/codex-docs > values.yaml

And finally, you can run Helm install command in to install chart to your cluster:

helm install codex-docs codex/codex-docs -n codex-docs -f values.yaml --create-namespace