Answers: <p>With docker compose (or docker swarm if you want to distribute the containers) create a container for each Git repository. This should map well to docker’s philosophy of each container being used for a <strong>single purpose</strong>.</p>
  
  <p>As far as examples go, I can recommend you have a look at <a href="https://github.com/mayaculpa/veleda" rel="nofollow noreferrer">veleda</a> (shameless self-promotion) which combines 3 databases, a flask app, a ruby app (Grafana), Jekyll and nginx. It also includes unit tests that are integrated into Travis-ci and should be transferable to circle-ci.</p>
  
  <p>Regarding the nginx aspect, 030 already mentioned that there are finished images to make your life easier. Even ones that include automated <a href="https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion/blob/master/README.md" rel="nofollow noreferrer">Let’s Encrypt services</a>. </p>
  
  <p>Ansible can be integrated well into the mix. If you used it to install dependencies and network configurations, this is now handled by docker. For SSH-based tasks, ansible remains useful. Check out this <a href="https://rhonabwy.com/2016/06/19/marathon-kubernetes-docker-compose-terraform-puppet-chef-ansible-saltstack-and-juju/" rel="nofollow noreferrer">comparison</a> of tools and their scope’s of responsibility. </p>
  
Answers: CC BY-SA 3.0
Answers: 2018-02-18T13:48:05.653Z
Answers: So I would have CircleCI setup to run Ansible playbook that would SSH into a target server, install Docker and docker-compose, pull git repositories and run docker-compose?
Answers: user134865
Answers: CC BY-SA 3.0
Answers: 2018-02-18T16:46:39.733Z
Answers: And don’t forget secret management. Not sure how we’ll circle ci supports it, but it’s quite easy on Travis. Here are two good guides: https://gist.github.com/nickbclifford/16c5be884c8a15dca02dca09f65f97bd and https://kjaer.io/travis/
Answers: Moritz
Answers: CC BY-SA 3.0
Answers: 2018-02-19T00:03:33.550Z
Answers: I handle secrets via ansible-vault and CircleCI's environment variables.
Answers: user134865
Answers: CC BY-SA 3.0
Answers: 2018-02-16T00:18:52.533Z
Answers: 2018-02-16T00:18:52.533Z
Answers: Moritz
Body: <p>I need some help and be pointed in the correct direction.</p>
  
  <p>I have 6 git repositories that together combine a bigger application (3 Node.js API, 2 React web apps and one repository for Ansible and templates for config files for the other repos).</p>
  
  <p>Currently we are building it only with Ansible and CircleCI but the current build process is not that great and I think of moving to Docker, docker-compose and CircleCI 2.0.</p>
  
  <p>The thing is: <strong>how should I dockerize it?</strong></p>
  
  <p>All the databases are remote. How should I approach nginx?</p>
  
  <p>I thought about writing Dockerfiles for each application and then using Ansible to connect to host, install Docker, pull sources and start building containers from Dockerfiles.</p>
  
  <p>Nginx should be configured by Ansible on host or can it be made into a Docker container somehow?</p>
  
Tags: <docker><ansible><docker-compose><circleci-2.0>
Title: Six repositories as a single deployment Docker+CircleCI
UserDisplayName: user134865
ThreadText: # Six repositories as a single deployment Docker+CircleCI
  
  (Asked by: username_0 on 2017-08-16)
  
  I need some help and be pointed in the correct direction.
  
  I have 6 git repositories that together combine a bigger application (3 Node.js API, 2 React web apps and one repository for Ansible and templates for config files for the other repos).
  
  Currently we are building it only with Ansible and CircleCI but the current build process is not that great and I think of moving to Docker, docker-compose and CircleCI 2.0.
  
  The thing is: **how should I dockerize it?**
  
  All the databases are remote. How should I approach nginx?
  
  I thought about writing Dockerfiles for each application and then using Ansible to connect to host, install Docker, pull sources and start building containers from Dockerfiles.
  
  Nginx should be configured by Ansible on host or can it be made into a Docker container somehow?
  
  **Tags:** docker, ansible, docker-compose, circleci-2.0
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-02-16. Score: 1 | Accepted answer
  
  With docker compose (or docker swarm if you want to distribute the containers) create a container for each Git repository. This should map well to docker’s philosophy of each container being used for a **single purpose**.
  
  As far as examples go, I can recommend you have a look at [veleda](https://github.com/mayaculpa/veleda) (shameless self-promotion) which combines 3 databases, a flask app, a ruby app (Grafana), Jekyll and nginx. It also includes unit tests that are integrated into Travis-ci and should be transferable to circle-ci.
  
  Regarding the nginx aspect, 030 already mentioned that there are finished images to make your life easier. Even ones that include automated [Let’s Encrypt services](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion/blob/master/README.md).
  
  Ansible can be integrated well into the mix. If you used it to install dependencies and network configurations, this is now handled by docker. For SSH-based tasks, ansible remains useful. Check out this [comparison](https://rhonabwy.com/2016/06/19/marathon-kubernetes-docker-compose-terraform-puppet-chef-ansible-saltstack-and-juju/) of tools and their scope’s of responsibility.
  
  > **Comments:**
  > **username_0**: So I would have CircleCI setup to run Ansible playbook that would SSH into a target server, install Docker and docker-compose, pull git repositories and run docker-compose?  
  > **username_1**: And don’t forget secret management. Not sure how we’ll circle ci supports it, but it’s quite easy on Travis. Here are two good guides: https://gist.github.com/nickbclifford/16c5be884c8a15dca02dca09f65f97bd and https://kjaer.io/travis/  
  > **username_0**: I handle secrets via ansible-vault and CircleCI's environment variables.  
  
  ---
  
  