guideDocker

A valid license key is needed in order to install CKEditor Cloud Services On-Premises.
Contact us for a trial license key.

# Setting up the application using the Docker container

Follow the steps below to install CKEditor Cloud Services On-Premises using the Docker container.

  1. Use instructions from the CKEditor Ecosystem customer dashboard to log into the CKEditor Cloud Services On-Premises Docker Registry and pull the Docker image.
  2. Containerize the application using docker or docker-compose.
  3. Create the Environment with a SecretKey via Environments Management App. Use this data to create the token endpoint and run tests.
  4. Run tests to verify if the system works properly — see Testing the CKEditor Cloud Services On-Premises application.
  5. Configure the server endpoints in the CKEditor Collaboration web application to communicate with the CKEditor Cloud Services On-Premises application — see Setting endpoints.

# Containerize example using docker

Launch the Docker container:

docker run --init -p 8000:8000 -v /path/to/your/dir:/var/cs/easyimage -e MYSQL_HOST=[your_mysql_host] -e MYSQL_USER=[your_mysql_user] -e MYSQL_PASSWORD=[your_mysql_password] -e REDIS_HOST=[your_redis_host] -e LICENSE_KEY=[your_license_key] docker.cke-cs.com/cs:[version]

Notes:

  • You should always mount the docker volume -v /path/to/your/dir:/var/cs/easyimage to preserve uploaded files in case your Docker container gets removed.
  • Use environment variables to configure the application. See Docker container environment variables. Examples:
    • If an SQL database and Redis are hosted on 192.168.118.27, you should pass the address through the MYSQL_HOST and REDIS_HOST variables:
      docker run --init -p 8000:8000 -v ~/easyimage_files:/var/cs/easyimage -e MYSQL_HOST=192.168.118.27 -e REDIS_HOST=192.168.118.27 -e MYSQL_USER=root -e MYSQL_PASSWORD=root_password -e LICENSE_KEY=[your_license_key] docker.cke-cs.com/cs:[version]
      
    • If you want to change the port on which the application will be served to 5000, override the APPLICATION_HTTP_PORT variable and change exposed ports:
      docker run --init -p 5000:5000 -v ~/easyimage_files:/var/cs/easyimage -e APPLICATION_HTTP_PORT=5000 -e MYSQL_HOST=192.168.118.27 -e REDIS_HOST=192.168.118.27 -e MYSQL_USER=root -e MYSQL_PASSWORD=root_password -e LICENSE_KEY=[your_license_key] docker.cke-cs.com/cs:[version]
      
  • You should override the ENVIRONMENTS_MANAGEMENT_SECRET_KEY variable using a unique and hard to guess string due to security reasons.
  • Without a correct LICENSE_KEY the application will not start.

# Containerize example using docker-compose

Use the steps below to containerize the application using docker-compose.

  1. Go to the installation package root directory where the Dockerfile exists.
  2. Create the docker-compose.yml file:
    version: "2.2"
    services:
      mysql-database:
        image: mysql:5.6.38
        environment:
          MYSQL_ROOT_PASSWORD: password
        volumes:
          - ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
    
      redis:
        image: redis:3.2.6
    
      ckeditor-cs:
        image: docker.cke-cs.com/cs:[version]
        depends_on:
          - redis
          - mysql-database
        ports:
          - "8000:8000"
        restart: always
        init: true
        environment:
          MYSQL_HOST: mysql-database
          MYSQL_USER: root
          MYSQL_PASSWORD: password
          REDIS_HOST: redis
          ENVIRONMENTS_MANAGEMENT_SECRET_KEY: secret
          LICENSE_KEY: your_license_key
        volumes:
          - ~/easyimage_files:/var/cs/easyimage
    
  3. Create the init.sql file:
    CREATE DATABASE `cs-on-premises`
      DEFAULT CHARACTER SET utf8mb4
      DEFAULT COLLATE utf8mb4_unicode_ci;
    
  4. Run:
    docker-compose up
    

Notes:

  • You should always mount the Docker volume to preserve uploaded files in case your Docker container gets removed.
  • Use environment variables to configure the application. See Docker container environment variables.
  • You should override the ENVIRONMENTS_MANAGEMENT_SECRET_KEY variable using a unique and hard to guess string due to security reasons.
  • Without a correct LICENSE_KEY the application will not start.

# Docker container environment variables

These are the environment variables that are used to configure the application when the container is started.

MYSQL_HOST                          - required
MYSQL_PORT                          - optional (default: 3306)
MYSQL_USER                          - required
MYSQL_PASSWORD                      - required
MYSQL_DATABASE                      - optional (default: "cs-on-premises")
REDIS_HOST                          - required
REDIS_PORT                          - optional (default: 6379)
REDIS_DB                            - optional (default: 1)
REDIS_PASSWORD                      - optional (default: "")
REDIS_CLUSTER_NODES                 - optional (default: "")
APPLICATION_HTTP_PORT               - optional (default: 8000)
APPLICATION_EXTERNAL_ENDPOINT       - optional (default: "")
ENVIRONMENTS_MANAGEMENT_SECRET_KEY  - optional (default: "secret"), but it is highly recommeneded you change it
LICENSE_KEY                         - required

# Examples

Here are some examples of the REDIS_CLUSTER_NODES variable:

REDIS_CLUSTER_NODES=192.168.0.5:7000,192.168.0.5:7001,192.168.0.5:7002
REDIS_CLUSTER_NODES=192.168.0.5:7000:password1,192.168.0.5:7001:password2,192.168.0.5:7002:password3