I have a Go service (it's a simple CRUD web server) that I want to deploy to one of my Digital Ocean droplets. My idea was to have mainly two things in my droplet: nginx, and a single binary (my Go service). The binary would be built in our CI pipeline.<p>Now, my colleague says that it would be better to deploy a Docker container (the image would be built in our CI pipeline). We do containerize PHP and Python apps (and I see the value of doing it), but I just don't see the added value of deploying Docker containers for Go apps in production (I think it even introduces a small performance penalty, since the Go binary wouldn't be running "bare metal" in my droplet).
Personally I don't use Docker containers for Go applications, but there is nothing wrong with putting everything in Docker for consistency. Most projects I know use Docker, even when its not needed, just for the consistency.<p>One minimal Docker option with Go is to use a "distroless" Docker image: <a href="https://github.com/GoogleContainerTools/distroless/blob/main/examples/go/Dockerfile" rel="nofollow">https://github.com/GoogleContainerTools/distroless/blob/main...</a>