Creating a Dockerfile for the Deno application
A Dockerfile
will allow us to specify what is required to create a new Docker image. This image will provide an environment containing all dependencies of the application, which can be used both for development purposes and for production deployments.
What we'll do in this section is learn how to create a Docker image for the Deno application. Docker provides a base image that is pretty much just the container runtime with isolation, called alpine
. We could use that image, configure it, install all the tools and dependencies we need (namely Deno), and so on. However, I believe that we shouldn't be reinventing the wheel here, thus we're using a community Docker image.
Even though this image solves many of our problems, we still need to tweak it to our use case. Dockerfiles can be composed, which means they can extend other Docker images' functionality, and that's what we'll use.
Important note
As...