Preparing an application

Let's start with a tutorial application proposed by the Docker documentation:

  1. To begin, we need Dockerfile, which is a definition of how our container environment should look. It contains keywords such as FROM (defines an image that will be used for the container), WORKDIR (the working directory of the application), ADD (adds a directory to a container), RUN (runs a command), EXPOSE (exposes a given port in the container), ENV (adds an environment variable), and CMD (declares an entry point):
FROM python:2.7-slimWORKDIR /appADD . /appRUN pip install --trusted-host pypi.python.org -r requirements.txtEXPOSE 80ENV NAME HandsOnAzureCMD ["python", "app.py"]
  1. We will need two more files:
    • requirements.txt: This one defines ...

Get Hands-On Azure for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.