Pregunta

In development I have a Java backend API which I'm running with Tomcat. I'm wanting to wrap the backend in a docker container and deploy to an AWS EC2 instance, and be able to scale up/down.

Does every docker container need to have a separate Tomcat server running? I don't know any way around it, but I guess it just seems like a lot of overhead (1GB-2GB memory, 500MB disc space) per container.

¿Fue útil?

Solución

In the Microservices architecture, usually, you want the flexibility to deploy the services independently and this requirement leads you to have one container per service with all the dependency and environment necessary to run it.

The default Java ecosystem is heavy to create cloud-native applications, but this is changing with projects like Quarkus and GraaVM where you can build cloud-native applications with high performance and low memory consumption.

Otros consejos

Consider using embedded Tomcat inside your application instead of deploying your app in a Tomcat instance. I prefer this approach in general but it's definitely much more aligned with micro-service architectures and containers.

You don't need docker in this instance.

Tomcat is already a container running system which can run multiple seperate websites and apis

Licenciado bajo: CC-BY-SA con atribución
scroll top