I am trying to integrate docker containers in my simple CI pipeline for deploying a webapp.
I have 3 containers with nginx, tomcat and mysql.
I understood the basics of how to create these containers using Dockerfiles and linking them together.
My artifacts are uploaded to a Nexus server and I see different ways for deploying an artifact on docker containers.
One would be to rebuild the tomcat container pulling the newly generated artifact and copying it in the container with ADD in the Dockerfile.
Another way would be to start the unchanged Tomcat container mounting a volume on the host containing the new artifact fetched from nexus.
I do not understand what would be the correct approach from a 'docker point of view'. I can see a tradeoff between reusability of a container with some configuration against a one fixed container that I can just ship and run without an extra processes of providing webapp folder for deployment etc.
It's a general confusion I have. Same for nginx container. Should specific changes in the config files lead to a rebuild of the container or should I just mount some file on the host machine when I start the container?
Thanks a lot