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

Unlock the full course today

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

Link the Java application and database Docker containers

Link the Java application and database Docker containers

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

Start my 1-month free trial

Link the Java application and database Docker containers

- [Instructor] So, now that we know how to Dockerize our application, let's configure it to connect with our explorecali database container. Before we start, we have to make sure there are no existing images or container of our application, so let's go to the command line and do docker ps -a. We don't have any containers running for the application, just the ec-mysql container which is good 'cause we're gonna interact with it. Now we're going to see if there is any images of our application. And we do see we do have the explorecali image in Docker, we don't want that, so we're gonna remove it because we're gonna generate a new one that's database aware. Rmi means remove image. And we've removed that image. And it's gone, so the only thing we have is mysql and Java 8, clear the screen up a bit. And let's look at two changes that were made to the application. One is the Docker file, so now our Docker file has a profile setting. We've added the environment variable -…

Contents