In this section we'll see how to deploy a Ktor application to a Docker container which can then be run either locally or on your cloud provider of choice.
Docker is a container system that allows for packaging software in a format that can then be run on any platform that supports Docker, such as Linux, macOS, and Windows. Conceptually Docker is an operating system with layers providing multiple services. While the basics of Docker will be covered, if you're not familiar with it, check out some of the Getting Started documentation.
Getting the application ready
In order to run on Docker, the application needs to have all the required files deployed to the container. As a first step, you need to create a zip file containing the application and its dependencies. Depending on the build system you're using, there are different ways to accomplish this.
The example below will be using Gradle and the application plugin to accomplish this. If using Maven, the same thing can be accomplished using the assembly functionality.