Deploying pimentaCHAT on OpenShift

This guide covers how to host pimentaCHAT on OpenShift Online Next Gen.

OpenShift Online Next Gen is a completely rewritten PaaS solution based on Docker and Kubernetes that allows developers to quickly develop, host and scale application in a cloud environment. OpenShift provides a CLI based tool that allows manage your projects and applications. Please refer to Getting Started with the CLI documentation in OpenShift website.

Table of Contents

  1. Login
  2. Create a project
  3. Import the ImageStream and templates
  4. Create the app

1. Login

First of all we need to login to OpenShift API URL to create our project. The command to login to OpenShift Online Next Gen is shown below:

# oc login https://api.preview.openshift.com --token=<api_token>

You can find the API Token to login to OpenShift Online Next Gen in the about page of the Web console.

2. Create a project

After login to OpenShift Online Next Gen, we need to create a project to host our pimentaCHAT application:

$ oc new-project pimenta-chat

3. Import the ImageStream and templates

Clone the pimentaCHAT GitHub repository and import the templates to your OpenShift project:

# git clone https://bitbucket.org/pimenta-group/pimenta.chat
# cd pimentaCHAT
# oc create -f .openshift/pimenta-chat-ephemeral.json
# oc create -f .openshift/pimenta-chat-persistent.json

4. Create the app

Create the application using the newly created templated and passing the MONGODB_DATABASE,MONGODB_USER and MONGODB_PASSWORD parameters:

# oc new-app pimenta-chat -p MONGODB_DATABASE=pimentachat -p MONGODB_USER=pimentachat-admin -p MONGODB_PASSWORD=pimentachat
  • pimentaCHAT uses a domain check code to verify the validity of the e-mail address. To disable it, run the following commands:
# oc port-forward <mongodb_pod> 27017
# mongo localhost:27017

> use pimentachat
> db.auth('pimentachat-admin','pimentachat')
> db.pimentachat_settings.update({_id:'Accounts_UseDNSDomainCheck'},{$set:{value:false}})