Cant connect to database with Docker
-
Locally, I can connect to the DB with npm start
I can
docker build test .
anddocker 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.logpublic/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.rsspidfile
templates
/public/templates
/public/uploads
/public/soundscompiled files
/public/stylesheet.css
/public/admin.css
/public/nodebb.min.js
/public/nodebb.min.js.map
/public/acp.min.js
/public/acp.min.js.mapCovers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
*.iml
Directory-based project format:
.idea/
.vscode/File-based project format:
*.ipr
*.iwsTransifex
tx.exe
.transifexrc##Coverage output
coverageZip 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