From the course: Docker for Data Engineers

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Specifying the Dockerfile to run a Python application

Specifying the Dockerfile to run a Python application - Docker Tutorial

From the course: Docker for Data Engineers

Specifying the Dockerfile to run a Python application

So far, our containers didn't really run a meaningful process. We'll change that in this demo. We'll create and run a container that runs a simple Flask Python application. Flask is a Python web services framework. It's a microservices framework, it's very lightweight, and it's great for running simple web apps. Here in the docker-demos folder, I have all of the files that make up my application. The Dockerfile, of course, is used to build the image for the container. Requirements.txt contains all of the dependencies for my Flask app. My Flask app actually runs within the app.py file. In order to demonstrate some interesting things about container commands, I have not just one Flask application within this folder, I have three. These applications are present in the file with the .py extension. The first is, of course, app.py. All this web app does is a return a message. My first app in a container is app and running, and this app runs on Port 5000. You can see this on line 12. The…

Contents