colloqi/pisignage-server

Mongo URL not configurable in Docker image

zegerhoogeboom opened this issue · 2 comments

The config/env/production.js file contains this for me in the latest pisignage/pisignage-server docker image:

/pisignage-server # cat config/env/production.js 
'use strict';

module.exports = {
    env: 'production',
    https: false,
    port: process.env.PORT || 3000,
    mongo: {
        uri: 'mongodb://mongo:27017/pisignage-server-dev' ,
        options: {useMongoClient: true}
    }
};

This was very confusing for me as I can see the current production.js in Github contains this instead which allows the configuration of the mongo URL through an environment url:

'use strict';

module.exports = {
    env: 'production',
    https: true,
    port: process.env.PORT || 443,
    mongo: {
        uri: process.env.MONGOLAB_URI ||
        process.env.MONGOHQ_URL ||
        'mongodb://127.0.0.1:27017/pisignage-server',
        options: {useMongoClient: true}
    }
};

It would be better if the URL can be configured while using the docker image or otherwise if it's documented somewhere.

Sorry for the confusion, made simplification for the Docker image. Now modified the file as follows to include URLs


'use strict';

module.exports = {
    env: 'production',
    https: false,
    port: process.env.PORT || 3000,
    mongo: {
        uri: process.env.MONGOLAB_URI ||
            process.env.MONGOHQ_URL ||
            'mongodb://mongo:27017/pisignage-server-dev',
        options: {useMongoClient: true}
    }
}

Also added differences in README file, you can change to docker-build branch and generate your own docker image. Files to watch are

  • Dockerfile
  • docker-compose.prod.yml
  • config/all.js
  • config/dev/production.js
  • server.js

Also, there is a document "Creating Docker Image" on how we created docker image

Perfect, then I think this issue can be closed!