Define application properties on build using Spring Boot and Maven

I have a spring boot application that uses a database. I have the local configuration in the application.properties file. I understand it is possible to change the values when I build the project with maven. I want to set the production values (db on AWS).

Here is application.properties

  • Docker can't start on centos7: failed to start docker application container engine
  • Docker use different filesystems in a container
  • Docker image from existing Rails/Unicorn/MySQL app
  • trouble getting docker image up and runnig
  • Automated pulling from gitolite repo within docker container
  • Does file touch create a copy in the docker container layer?
  • spring.datasource.url=${db.url:jdbc:postgresql://localhost:5432/mydb}
    spring.datasource.username=${db.username:localusername}
    spring.datasource.password=${db.password:localpassword}
    

    I would like to change the values when I run. This will create a docker image.

    mvn package docker:build
    

    Is it possible?

  • HTTP(S) Load Balancing for Kubernetes / Docker
  • docker build access host folder
  • How to connect MySQL client with server running in Docker
  • Issue returning https url when returning response from a docker container
  • Automatic building and installing Packages from AUR for Arch Linux inside Docker with yaourt and >makepkg-4.2.0
  • Connect to database from another docker container
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.