6

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?

user134865
  • 163
  • 4

1 Answers1

1

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 (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.

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 of tools and their scope’s of responsibility.

Moritz
  • 1,227
  • 2
  • 11
  • 24