A practical guide to Docker containers
Creating a static website using Nginx:Alpine Docker image
Introduction
- Most of IT professionals today are theoretically well versed in architecture and benefits of containers such as scalability, portability, security and development speed. I wanted to put together a tutorial to show a sample workflow of authoring a customized Docker image and launching the container. Thanks goes to Vadim Kacherov, our Microsoft Technology Center Architect, who gave me a few pointers for this article.
This linked page is running in that manner, and by the end of the tutorial you will have a site running very similarly to this. Recently I was inspired by Kyle Mathews post and decided to build the similar solution and host it on Azure Linux Web App. Microsoft has recently launched a public preview of Linux Web App on Azure cloud. What's awesome is that it also supports custom Docker containers. This is an excellent opportunity for micro blogs and static websites. This solution has a lot of attractive characteristics:
- No VM or OS patching and managing headache: we will run on a serverless fully managed platform
- Nginx is a light weight web server, Alpine flavor of which will result in less than 60MB container
- Static web sites don't rely on PHP and MySQL presenting fewer attack surfaces
- Container and Web App don't have SSH enabled thus further limiting security exposure
Head over to my GitHub for detailed tutorial steps and code artifacts.