Skip to content

A Dockerfile used to create a Docker Image for running ConnextCMS and KeystoneJS in a Docker Container

License

Notifications You must be signed in to change notification settings

christroutner/docker-connextcms

 
 

Repository files navigation

docker-connextcms

A Dockerfile used to create a Docker Image for running ConnextCMS and KeystoneJS in a Docker Container.

This repository contains two Dockerfiles and a docker-compose file. The Dockerfile in this root directory will create a Docker image with a functional version of ConnextCMS and KeystoneJS. It depends on the official mongo Docker image, and a repository of pre-compiled KeystoneJS code generated by the second Docker image.

A second Dockerfile exists in the buildFromSource directory. This creates an environment ready to run the yo keystone command to build KeystoneJS from scratch. This environment is used to create and update the keystone4-compiled repository used by the first Dockerfile.

Installation

It's assumed that you are starting with a fresh installation of Ubuntu 16.04 LTS on a 64-bit machine. It's also assumed that you are installing as a non-root user with sudo privileges.

  1. Install Docker on the host system. This tutorial shows how to install Docker on a Ubuntu 16.04 system. It's specifically targeted to Digital Ocean's cloud servers, but should work for any Ubuntnu system. Use this link to sign up for a Digital Ocean account and get a $10 credit, capable of running a $5 server for two months.

  2. Install Docker Compose too. This tutorial shows how to do so on a Ubuntu system.

  3. Clone this repository in your home directory with the following command: git clone https://github.com/skagitpublishing/docker-connextcms

  4. (Optional) Add any plugins or your own customized plugin-template to the plugins directory. Or add your own customized site-template to the theme directory. Be sure to edit the mergeandlaunch script to execute each merge script required to merge your plugins and site files into ConnextCMS Core at load time.

  5. Build the ConnextCMS docker container. The --no-cache option should be used to prevent issues with symbolic links. docker-compose build --no-cache

  6. Bring ConnextCMS/KeystoneJS online by running the following command: docker-compose up -d

Docker will then launch the ConnextCMS Docker image. At the end, KeystoneJS will be running on port 3000, with ConnextCMS running with it. For additional information on how to setup a production server with this container, see the three-part video series on ConnextCMS.com.

You can also follow these nginx instructions to setup nginx in front of your Docker container in order to forward traffic from port 80 (the normal web browser port) to port 3000, and also how to install an SSL certificate from Let's Encrypt for implementing HTTPS.

Docker Debugging

The following commands are useful for debugging applications like this one inside a Docker container. The commands below help you to enter a shell inside the container.

  • docker build -t test-container .

    • This command will build a Docker image from the Dockerfile in the current directory.
  • docker ps -a

    • Show all docker processes, including ones that are stopped.
  • docker container run --name test-container --rm -it <Image ID> bash

    • This command will run a docker container and drop you into a bash shell. All you need is the image ID.
  • docker exec -it <container ID> bash

    • This command will let you enter a bash shell inside a running Docker container.

License

MIT License

Copyright (c) 2017 Skagit Publishing

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A Dockerfile used to create a Docker Image for running ConnextCMS and KeystoneJS in a Docker Container

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 66.1%
  • Shell 33.9%