Java + Docker: Different datasource url

I’m working on a Spring Boot project which I want to run in a docker environment. The project is split up in different modules each having it’s own Dockerfile so I’m using docker compose to combine these. I have one service for the db:

db:
      image: postgres:9.5
      ports:
       - 5432:5432
      environment:
        POSTGRES_USER: postgres
        POSTGRES_PASSWORD: 123456
        POSTGRES_DB: db1

The module which work with the db has the datasource set: spring.datasource.url= jdbc:postgresql://db:5432/db1

  • uwsgi layer blocks one particular API call from nginx
  • Nginx 502: Bad Gateway with rstudio server
  • Setting the Docker's container environnement (Env) via the docker remote api
  • Docker: in memory file system
  • Docker not responding to CTRL+C in terminal
  • the command “docker-machine ls ” list nothing on my mac
  • The problem is that I have colleagues who do not want to run it in docker for performance reasons (Windows + Mac user). They rely on spring.datasource.url= jdbc:postgresql://localhost:5432/db1. Can I use different datasources depending on the environment the module is running?

  • “Installing Docker: FAILED” Error on setup with Meteor-Up and Debian 7 wheezy
  • Addressing issues with Apache Spark application run in Client mode from Docker container
  • What is cloudfront link?
  • How to measure linux bridge overhead (cpu usage)
  • How use Dokku with django?
  • Docker machine is active, but shown as aborted in Virtual Box
  • One Solution collect form web for “Java + Docker: Different datasource url”

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.