Firstly, I use a MacBook Pro running Sierra. I’m sure this series can be easily ported to Linux with minimum effort. If you’re on Windows though, you’re on your own I’m afraid.
This demo is a simplified version of what I, and my team, actually use. I know it works because we use it every day.
setup.sh script in this demo doesn’t check for any installed software. In my non-demo version I do a number of checks for software dependencies of my applications.
This is required for the
$ brew install direnv
This service is required for the Nginx reverse proxy we will setup, allowing requests to be proxied from within a Docker container back to our host. More about this later…
dnsmasq must be run with root privileges.
$ brew install dnsmasq $ sudo brew services start dnsmasq
This is required for the forwarding of logs to Elasticsearch.
$ brew install filebeat
pg gem (in the demo Rails app) has native extensions which require the presence of PostgreSQL binaries for installation. We don’t actually run this service.
$ brew install postgresql
A very handy utility which we will use for real-time monitoring of our stack. I covered watch in previous article.
$ brew install watch
Setting up the stack
We are now ready to create our stack. Check out the docker-demo-stack repository and run the setup script:
$ git clone firstname.lastname@example.org:edjames/docker-demo-stack.git $ cd docker-demo-stack $ setup.sh
You should see something like this:
What just happened?
setup.sh script does 3 things:
- Checks for the presence of
dnsmasqconfiguration. If it doesn’t exist or doesn’t match the templates, the configuration is created.
- Ensure that the
.envrcfile is allowed and loaded by
- Restart the
dnsmasqservice, running as root.
This article provides a great explanation of
dnsmasq setup (and what the
setup.sh script has just done for you).
We are now ready to actually build our containers…