docker compose watch (AKA hot reload) is now available to everyone. It’s a nice tool for automatic updating of running containers upon save.
Something I haven’t seen discussed much on the internet or from Googling is how to use it with a Go project, so I thought I’d document how you can easily use it with yours.
Prerequisites
Make sure you have at least Docker Desktop 4.24 or Docker Compose standalone 2.22.0 installed.
Steps
(I’m assuming you have an existing Go project with a main.go in the root. You may need to adjust this setup some for your specific needs)