Y
Y
yabivipil2018-03-22 15:28:18
MySQL
yabivipil, 2018-03-22 15:28:18

How to properly run a java application with Jetty and Mysql in docker?

There is a java web application that is packaged in a war file.
The application is launched via jetty. It also works with mysql database.
I need to build a container that would run my web application.
There are two ways:
1. Spool mysql and jetty docker image and run via docker-compose up.
2. Create your own image, which would install mysql, jetty inside itself and run the war file.
Question: which way is correct and why?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yerlan Ibraev, 2018-03-22
@mad_nazgul

If possible, it is better to separate jetty and MySQL into different hosts/instances.
In general, it is not recommended to keep them in one image.
But it depends on the problem you are solving.

A
Alexander, 2018-03-22
@sah4ez32

The question is why do you need it)
If you play locally in the "sandbox". Probably both options will work.
If you are going to "production", then you probably need to put the base nearby and it's better not to docker, it's not about that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question