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.
Setting up the Dockerfile for model prediction - Docker Tutorial
From the course: Docker for Data Engineers
Setting up the Dockerfile for model prediction
We have our classification model serialized out to a pickle file. Let me just copy that model over to our docker-demos folder. This is the folder that is our current working directory for building our Docker image to run a containerized application for predictions. Now, here I have all of the contents of my docker-demos folder open. Let's look at the files that we have that make up our prediction application. Take a look at the right side of the screen. Notice that I have the app.py Python file. This is my actual Flask Python application that we'll use to perform predictions behind an endpoint. We'll look at the contents of this app.py in just a bit. We have the churn_pred_model.pkl file, that is our serialized trained model. We have the Dockerfile, which specifies the instructions to build our image. We have the gunicorn_config.py file. Now, we haven't really worked with Gunicorn before, but this is what we'll use to run a production-grade web server hosting our Flask application…
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)
Azure Container Instances1m 34s
-
(Locked)
Training an ML model and serializing to a pickle file5m 7s
-
(Locked)
Setting up the Dockerfile for model prediction5m 45s
-
(Locked)
Running a containerized app locally for churn prediction2m 23s
-
(Locked)
Authenticating to Azure using the Azure CLI1m 35s
-
(Locked)
Creating an Azure Container Registry and pushing the image3m 58s
-
(Locked)
Deploying a container to Azure Container Instances4m 9s
-
(Locked)
Making predictions using the containerized application2m 44s
-
(Locked)
-