How can I use docker container in this scenario ? And what should I do for continuous integration.?

It’s my first time for deployment of a website , I am using Spring boot. I was doing a traditional way, making a war file and deploying it on my vps’s Tomcat. Everything was going fine…but recently when I updated my code with some features and deployed it on Tomcat, it started showing errors. Doesn’t matter what, but each update can induce some issues because of some file or version . So I started thinking about docker.
I am new to it, though comfortable with docker a little.(have gone through self paced training on website and tried it successfully on my machine)
My question is, I don’t have extra budget to purchase a commercial docker , can I use docker container in this scenario ?
And what should I do for continuous integration in my case, so that if I add a new service I don’t have to go through the deployment of whole of the war file again and wait for hours, and still be vulnerable to internet connection errors

[quote=“techeklavya, post:1, topic:24459”]
I was doing a traditional way, making a war file and deploying it on my vps’s Tomcat. Everything was going fine…but recently when I updated my code with some features and deployed it on Tomcat, it started showing errors. Doesn’t matter what, but each update can induce some issues because of some file or version . So I started thinking about docker.[/quote]

Using Docker will certainly put you in control of your environment. You could deploy using a tomcat container that you control and make sure that your application is not affected by version changes until you change them. This is a good use case for using Docker (i.e., environment control)

[quote=“techeklavya, post:1, topic:24459”]
My question is, I don’t have extra budget to purchase a commercial docker , can I use docker container in this scenario ?[/quote]

If you control the VM’s that your application is being deployed on, you could add the Docker Engine and run your containers that way. If you don’t have control, then you might want to move to a container cloud like IBM Bluemix or Amazon EC2 Container Service. Either way you need to provide a Docker Engine to run your containers.

It sounds like your application uses a monolithic architecture and using Docker is not going to help you with that. There is no magic here. If you want to not have to build a whole war file and wait for hours then you need to stop building huge war files in the first place. Deploying your war file in Docker will be just as slow as deploying it anywhere else. The problem is the application architecture, not the technology.

This is not your fault. It’s the way Java Spring, and Ruby on Rails, and Python Jango, and other monolithic frameworks work. They produce huge MVC apps that get you up and running very quickly but the down-side is that every change requires redeploying the entire application. If you have internet network issues, Docker may actually make it worse because instead of deploying just a war file, you will be deploying a whole Docker image which, in case of tomcat, would be your war file + 355MB!

What you want to do is move to a microservice based architecture where your application is split up into independent microservices running in their own Docker containers. This means that each war file would contain a single Resource or just a few related resources communicating via REST API’s instead of an entire application. Then when one service needs to be updated, just that service needs to be redeployed. It would be a huge re-architecture of your application but that’s what it takes to gain speed and agility of deployment over deploying huge monoliths.

~jr

1 Like

Thank you very much John rofrano. Yes I do have control over my remote vm via putty. And thanks for suggesting microservices architecture, actually I was also thinking about it and you also confirmed now:-).