In my summer Holliday, i decided i wanted to get to know docker a little better, i have been playing it with it now and then through the years, but never really had my own setup. And what better way to learn, than doing some of your hobby projects. I have my Proxmox server running different things, and im already running a couple of LXC’s for that one.
– Cloudflare tunnel (For securely publishing sites and services)
– Home assistant
– And this wordpress site

This has been running flawless so far, but it still has some overhead compared to docker, plus i really wanted to learn something by doing it ๐ So i setup a Ubuntu server, and installed Docker, played around with it, and quickly figured out i needed Docker compose, to make things a little easier when updating. Declarative for the win :). I also installed Portainer to get a little GUI insight into what was going on, and its a great tool for getting a overview.

But back to the purpose of this blog post, updating with docker compose, its pretty simple from the command line, when you have your compose.yaml (docker-compose.yml etc etc). Updating is
docker compose pull
docker compose up -d
And your application is up and running again, im not diving into how everything docker compose is working, ask your nearest LLM about that ๐
I have installed all my stacks(My docker applications) in /opt/stacks, so there is a folder for each application (N8N, Netstat, Portainer etc.) And i would still have to SSH into my box, go to all the directories and run the above commands, and surely there is a better way to do that. So i created a small bash script, that starts with a folder & name of yaml file input. And iterates through all the folders and updates all the applications. If your interested, i put it in my github repo which you can find here https://github.com/anderskeis/DockerComposeUpdate , feedback is welcome. There is probably other ways to do this, but this was my first attempt, and it works great. I have put it into a Cronjob, so it runs weekly ๐
