Docker Community Forums

Share and learn in the Docker community.

Setting up containers with multiple applications

I’m quite sure that this has been asked before, but I’m going to ask something more specific hopefully.

I’m working on building an Java web hosted solution with a MySQL database and using Apache Tomcat as the Web and Application server. FYI. This is my first time using Docker.

Anyhow, my understanding is that the purpose of using docker is to have one container that encapsulates everything I need to run an application. True/False?

For example, in a traditional VM, I would go by installing an OS, setting up MySQL, installing JDK, installing and setting up Apache Tomcat and what ever else I need. Instead of doing all this within the OS, are we doing this within one container now? This is where I am confused actually.

I have seen that there are containers for Apache, MySQL and etc… OR is it that on my Host OS I’ll be running multiple containers and each container performing 1 specific job function. By this I mean, will I create one container for Apache Tomcat, one for MySQL, one for the application where I will deploy the WAR file and etc… If indeed this is the correct way to go by installing multiple containers per job function then how am I benefiting from Docker. The way I see it is that instead of me installing all this directly inside a single VM, i’m now just creating a container for each one.

I have purchased a CentOS 7 server from a web hosting company. It cam with mysql and apache preinstalled. Do i remove these and put them in their own containers?

I’m hoping I have no confused you guys. At the end of the day, I want to deploy my web hosted solution, access it from the web, connect to the db and give the users their data. I know this is common practice, just trying to wrap my head around it.

I appreciate all the help this community is providing to users like me.

Thank you,
Dockit

Hi :slight_smile:

What i would do in this case, is to have a mysql container, and a tomcat+application container.
The point of containers is to have a very little footprint on the server, also being able to deploy/rollback very easily with containers, also you can do rolling deployments so users wont have downtime.

Regarding the preinstalled mysql/apache, depending on what you’re going to do with the server, i would just uninstall them, and put everything in a container, i love the idea of all my applications i have, is gathered the same place, in this case, docker