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 - 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Building your first Docker image5m 46s
-
(Locked)
Overriding the CMD instruction1m 52s
-
(Locked)
Using the Python base image5m 18s
-
(Locked)
Running a container in interactive mode2m 29s
-
(Locked)
Specifying the Dockerfile to run a Python application6m 36s
-
(Locked)
Running the containerized Python application5m 7s
-
(Locked)
Running multiple containers from the same image3m 28s
-
(Locked)
Building an image that runs a setup script6m 14s
-
(Locked)
Overriding the ENTRYPOINT directive4m 38s
-
(Locked)
-
-
-