From the course: Extending, Securing, and Dockerizing Spring Boot Microservices

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Separate application image from database migration

Separate application image from database migration

From the course: Extending, Securing, and Dockerizing Spring Boot Microservices

Start my 1-month free trial

Separate application image from database migration

- [Instructor] We now know how to connect our application container with our explorecali database container. However, the database connection parameters and migration scripts are bundled in the application. In this video, we will create a new Spring profile that leverages Spring expression language and the flyaway location settings. Before we start, let's make sure that the previous images and containers are cleaned out and we still have the container running from the previous video, so let's clean that out. Our database container is still running and that's good. Now let's remove the image. And the image is removed. Now let's look at a new properties file I've created, application-docker.properties. It's pretty much identical to the application.mysql.properties but we're using Spring expression language so we can substitute in command line environment variables into the profile, so we'll have a value server, a value port, a value dbuser and a value dbpassword that would have to exist…

Contents