November 2018
Intermediate to advanced
606 pages
15h 7m
English
To use Docker images in SF, we will need a registry in Azure Container Registry. You can go back to Chapter 3, Deploying Web Applications as Containers, where I described in detail how to work with ACR and Docker.
Now we will try to deploy a simple Python application—to start, we will need Dockerfile, of course:
FROM python:2.7-slimWORKDIR /appADD . /appRUN pip install -r requirements.txtEXPOSE 80ENV NAME WorldCMD ["python", "app.py"]
Additionally, let's create a Python application, which will display simple text:
from flask import Flaskapp = Flask(__name__)@app.route("/")def hello(): return 'This is my first Service Fabric app!'if __name__ == "__main__": app.run(host='0.0.0.0', port=80)
Now, run the docker build command: ...