Using Docker Compose

Last Updated: Feb. 17th 2022 at 6:42pm

Docker Compose

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. To learn more about Compose, visit docker docs.

I’m using docker on a per node basis, which means I cram as many services as I can into one node to save on costs. This article is written from a developer point of view. Your production strategy will likely be different, likely with a kubernetes backend.

I’m going to create a reverse proxy (Traefik) and a docker GUI (Portainer) this will create a foundation so that you can use any of my cookbooks or create your own on top.

In order for this to work, you must already have docker-compose installed. I’ve also configured my subdomains (dns for production and etc/hosts for development). You will need to change in the .env file and maybe the compose file for your scenario.

Known issues/ Troubleshooting

If you get the error: ERR_TOO_MANY_REDIRECTS You are probably behind cloudflare and let’s encrypt. Change cloudfare to dns only or “full strict” should fix this.

References