<p>Suppose I want to create a Web app which consists of three different dockerized parts:</p>

<ol>
<li>Web Server (e.g. Nginx) for Frontend</li>
<li>API built with GO</li>
<li>Python Script which is run by 2. on demand</li>
</ol>

<p>Eg. When a user visits <em>example.com</em> the static frontend is served, they click on a button which triggers a call to the API, the API in turn calls and waits for the result of a Python Script. </p>

<p>Would I set up RESTful Endpoints for 2. and 3.? If the API should be publicly available would I create another NGINX instance, so it would be NGINX and Go inside a single container? How would I „collect“ the result of the Python script for the API, with another NGINX instance inside the Python container? Wouldn't that violate the principles of Docker and drastically reduce maintainability as I‘d have to maintain every NGINX instance?</p>

Alex Gogl
<p>I see two ways to handle this:</p>

<ul>
<li>Create a python web service instead of just a script and then you can call it directly and it can answer with the result (you might even get rid of the go api if all it's function is to forward the call)</li>
<li>If the python code has to be a script then it's basically part of the go web service and should be built into the same container</li>
</ul>
