I wish my code was half as good as my expectations for how my code should be. My lattes are better than my code, so maybe I should make latte art instead of ascii art
I love this! Will certainly adopt it, and might even turn this into an ansible recipe. My only two pieces of suggestion:
If you want to keep only one nginx per host, but have multiple applications running in container, perhaps you could look into using swarm. Have one stack for your proxy, and deploy other apps in their own stack, but have them communicate via a dedicated nginx network. You already have all the tools necessary, and deploying it becomes a matter of having the right docker-compose.yml files, which you can keep in a repo. It reduces the amount of dependencies on the host, and makes it a little faster to upgrade versions, or replacing proxy/load balancers down the road.
in your script you have the latest version of docker-compose hardcoded, but if you wanted to always get the latest version you could replace the line:
The above is going to query the github api to get a list of the most recent release, ignore the .sha256 file, filter out any fields that aren't download urls, find the right download for your distro, get only the actual url, and curl download it. Everything else in the script remains the same.
I love this! Will certainly adopt it, and might even turn this into an ansible recipe. My only two pieces of suggestion:
If you want to keep only one nginx per host, but have multiple applications running in container, perhaps you could look into using swarm. Have one stack for your proxy, and deploy other apps in their own stack, but have them communicate via a dedicated nginx network. You already have all the tools necessary, and deploying it becomes a matter of having the right docker-compose.yml files, which you can keep in a repo. It reduces the amount of dependencies on the host, and makes it a little faster to upgrade versions, or replacing proxy/load balancers down the road.
in your script you have the latest version of docker-compose hardcoded, but if you wanted to always get the latest version you could replace the line:
with:
The above is going to query the github api to get a list of the most recent release, ignore the
.sha256
file, filter out any fields that aren't download urls, find the right download for your distro, get only the actual url, and curl download it. Everything else in the script remains the same.Updated according to your advice, thanks!
Great!