
In this step, you will set up your workspace and create a simple Go web app, which you’ll later containerize. For an introduction to Docker, see The Docker Ecosystem: An Introduction to Common Components. An understanding of Docker and its architecture.You can follow this introduction to DigitalOcean DNS for details on how to add them. A DNS “A” record with your_domain pointing to your server’s public IP address.You can get one for free on Freenom, or use the domain registrar of your choice. This tutorial will use your_domain throughout. Docker Compose installed by following the first step of How To Install Docker Compose on Ubuntu 18.04.
Docker installed by following the first two steps of How To Install Docker on Ubuntu 18.04. For this tutorial the non-root user is sammy. You can set this up by following this initial server setup guide. An Ubuntu 18.04 server with root privileges, and a secondary, non-root account. At the end of this tutorial, you will have deployed a Go web app accessible at your domain with multiple routes, using Docker and secured with Let’s Encrypt certificates. You’ll use nginx-proxy with the Let’s Encrypt add-on as the reverse proxy. In this tutorial, you will deploy an example Go web application with gorilla/mux as the request router and Nginx as the web server, all inside Docker containers, orchestrated by Docker Compose. Its Let’s Encrypt add-on can accompany the nginx-proxy to automate the generation and renewal of certificates for proxied containers. The nginx-proxy is an automated system for Docker containers that greatly simplifies the process of configuring Nginx to serve as a reverse proxy. The benefits of using Nginx as a front-end web server are its performance, configurability, and TLS termination, which frees the app from completing these tasks. Instead of manually running containers, orchestration tools give developers the ability to control, scale, and extend a container simultaneously. It allows you to run multiple interconnected containers at the same time. Docker Compose is a container orchestration tool that facilitates modern app requirements. It enables developers to easily package apps along with their environments, which allows for quicker iteration cycles and better resource efficiency, while providing the same desired environment on each run. Introductionĭocker is the most common containerization software used today. The author selected the Free and Open Source Fund to receive a donation as part of the Write for DOnations program.