Docker provisioning with AppFlow

ttssdev
ttssdev
Sep 6, 2018 · 2 min read

Hey there, some time ago we developed a tool called AppFlow (for our own needs), it’s a multitenant environment automation tool based on Ansible which eases up the maintenance and automation of the infrastructures we’re help keep running. We also open sourced the whole thing which is always a good idea.

With the DevOps concept in mind AppFlow may help you setting up your legacy infrastructure and it’s components, like HAProxy, Percona MySQL Galera Clusters, etc — all things HA. But it can do more, it can also provision Docker containers.

Here’s a code snippet which will run Traefik load balancer, Portainer, MariaDB and WordPress locally as example:

Be sure to adapt line 8 accordingly to your local user(s).

To get the whole thing up and running do the following:

sudo pip3 install appflowecho "127.0.0.1 docker.test lb.test wp.test" | sudo tee --append /etc/hostsappflow init --env development --tenant examplegit clone https://github.com/ttssdev/appflow-example.git ~/.appflow/tenant/appflow-examplemkdir -p ~/.appflow/vault/example
echo "test" > ~/.appflow/vault/example/development
appflow provision --tenant example --limit local --tags docker

This will spin up http://docker.test on your local machine

Portainer running inside a Docker container

Traefik load balancer at http://lb.test

A nice load balancer for containers written in Go

and finally the WordPress container, http://wp.test

The well known WordPress welcome screen

Of course you can also use AppFlow to run the whole thing in high availability mode with three nodes for example, this is what we do if we don’t want to throw in Kubernetes (maybe due to limited hardware resources).

If all this sounds interesting to you drop use a line at AppFlow community Slack or check out the whole documentation over at read the docs.

ttssdev

Written by

ttssdev

UNIX Engineering

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade