how many docker containers should a java web app w/ database have?
<p>I'm trying to "dockerize" my java web application and finally run the docker image on EC2. </p>

<p>My application is a WAR file and connects to a database. There is also a python script which the application calls via REST. The python side uses the tornado webserver</p>

<p><strong>Question 1:</strong></p>

<p>Should I have the following Docker containers?</p>

<ol>
<li>Container for Application Server (Tomcat 7)</li>
<li>Container for HTTP Server (nginx of httpd)</li>
<li>Container for postgres db </li>
<li>Container for python script (this will have tornado web server and my python script). </li>
</ol>

<p><strong>Question 2:</strong></p>

<p>What is the best way to build dockerfile? I will have to do trial and error for what commands need to be put into the dockerfile for each container. Should I have an ubuntu VM on which I do trial and error and once I nail down which commands I need then put them into the dockerfile for that container?</p>