Deploy web app in docker data container vs volume : <p>I'm confused about common consensus that one shouldn't use data containers. I have specific use case that I want to accomplish.</p>

<p>I want to have docker nginx container and behind it some other container with application. To run newest version of my app I want to download ready container from my private docker registry. The application is for now purely static html, javascript something.</p>

<p>So my plan is to create docker image which will hold the files, and will specify a named volume in some /webapp folder. The nginx container will serve this volume. I do not see any other way how to move bunch of files to remote system the "docker containerized" way. <strong>Am I not actually creating cursed data container?</strong></p>

<p>Anyway what happens during app containers exchange? When I stop the app container the volume remains accesible, as it is placed on host. When I pull and start new version of app container. The volume will be created again and prefiled with image files stored at the same location, replacing the content on host so the nginx container will server from now new version of the application.Right? What happens when I will reference volume that does not exist yet from the nginx container.</p>

<p>It seem that named values are not automatically filed with the content of the image. As well I'm not sure how to create named volume in docker file as this syntax taken from <a href="https://boxboat.com/2016/06/18/docker-data-containers-and-named-volumes/">here</a> doesn't work </p>

<pre><code>FROM training/webapp

VOLUME webapp:/webapp
</code></pre>
