From the course: Extending, Securing, and Dockerizing Spring Boot Microservices
Unlock the full course today
Join today to access over 23,300 courses taught by industry experts.
Separate application image from database migration
From the course: Extending, Securing, and Dockerizing Spring Boot Microservices
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.