Cant connect to database with Docker



  • Locally, I can connect to the DB with npm start

    I can docker build test . and docker run test and see it lifted and running.

    Then I push it to Jenkins. Jenkins pull from my github and I have most things committed in github.

    When Jenkins builds the image, it does not run locally. Do I need to commit more stuff to github? Here is my current .gitignore for nodebb

    Thanks!

    /// my .gitignore file
    npm-debug.log

    public/src/nodebb.min.js
    !src/views/config.json
    public/css/*.css
    *.sublime-project
    *.sublime-workspace
    .project
    *.swp
    Vagrantfile
    .vagrant
    provision.sh
    *.komodoproject
    .DS_Store
    feeds/recent.rss

    pidfile

    templates

    /public/templates

    /public/uploads
    /public/sounds

    compiled files

    /public/stylesheet.css
    /public/admin.css
    /public/nodebb.min.js
    /public/nodebb.min.js.map
    /public/acp.min.js
    /public/acp.min.js.map

    Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio

    *.iml

    Directory-based project format:

    .idea/
    .vscode/

    File-based project format:

    *.ipr
    *.iws

    Transifex

    tx.exe
    .transifexrc

    ##Coverage output
    coverage

    Zip files for deployment

    *.zip

    Database Backups

    databaseBackups/



  • I run this docker image in google cloud platform from jenkins. If I grab teh jenkins built image and run it locally, it works as well. It must be that I am blocked to get an external DB connection from within google cloud. Im not sure about that though since the mongodb is hosted in mongolab and the ip is public :(


Log in to reply
 

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