Installation on OpenShift Online v3



  • Hi there !

    There are big differences between OpenShift version 2 and 3, now the service work mostly with Docker and Kubernetes features, instead of simple gears.

    So here's my attempt to install NodeBB and Redis database using Openshift.

    First I created a new project :

    oc new-project community-dev --display-name="Community Development Project" --description="Development project for community using NodeBB and Redis"
    

    Then I built and deployed a Redis instance :

    oc new-app --docker-image=nodebb/docker:centos-redis --name="redis" --labels="dedicated=nodebb"
    

    NodeBB build :

    oc new-app --image-stream=nodejs:4 --code=https://github.com/NodeBB/NodeBB.git#v1.1.2 --name="nodebb" -e database=redis,redis__host=redis,redis__database=0,port=8080
    

    I also gived to Redis a persistent storage volume

    oc volume dc/redis --add --name="redis" -t pvc --claim-name="redis" --claim-size=1G
    

    I finally exposed the nodebb service using port 8080

    oc expose service nodebb -l app=nodebb
    

    This gives me an URL to see nodebb instance

    result

    But the page still like this

    alt text

    I was wondering if the problem occurs because NodeBB tries to kill the process node loader.js, since it's the process used in npm start which is the default command to start with OpenShift. If we kill this process, the pod is automatically restarted.

    This is the log from the pod :

    Environment: 
    	DEV_MODE=false
    	NODE_ENV=production
    	DEBUG_PORT=5858
    Launching via npm...
    npm info it worked if it ends with ok
    npm info using npm@2.15.1
    npm info using node@v4.4.2
    npm info prestart nodebb@1.1.2
    npm info start nodebb@1.1.2
    
    > nodebb@1.1.2 start /opt/app-root/src
    > node loader.js
    
    1/9 18:56 [32] - info: Launching web installer on port 8080
    1/9 18:56 [32] - info: Web installer listening on http://0.0.0.0:8080
    

    Is there a possiblity to start nodebb in an other way without forking the github repo ?

    Thank you.



  • Since ./nodebb start command run in background, OpenShift seems to fail in loop, because for him the command the process is terminated. So I just changed npm start command in package.json

    "scripts": { "start": "./nodebb setup && ./nodebb dev" }
    

    I need to fork the entire repo only for this line, which is a bit sad. Could be nice to have something like an environment variable to start nodebb in a blocking way.


Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.