Deploy a Go Web Server with Docker


This is a sample Go web server powered by the Gin web framework. You can use it as a starting point for deploying your own Go web apps on Render.

The sample app is a Dockerized version of Gin’s realtime chat example, and is available at https://go-web.onrender.com.

The app uses server-sent events (SSEs) to broadcast messages.

It also uses multi-stage Docker builds to keep the final image size as small as possible.

Deployment

  1. Fork render-examples/go-web-server on GitHub.

  2. Create a new Web Service on Render, and give Render’s GitHub app permission to access your new repo.

  3. Enter a name for the service; make sure the Environment is set to Docker, and save.

That’s it! Your Go, Gin, and SSE powered chat server will be available on the URL in the dashboard as soon as the build finishes.