From the course: Docker for Data Engineers

Unlock this course with a free trial

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

Building an image that runs a setup script

Building an image that runs a setup script - Docker Tutorial

From the course: Docker for Data Engineers

Building an image that runs a setup script

In this demo, we'll build a slightly more meaningful Python Flask application. This Flask application will read the contents of a CSV file that we bundle up with our container and display a sample of the data in the file and the statistical summary of the files data in the app. The app will display these details to screen in a plain text tabular representation. Now, this is a Flask app as before. Now, the contents of the file that we want the app to read in is passed in as an input argument on the command line when we run the Flask app. And these contents are available in sys.argv and we access those line 11. Within the home function, that is, at the /route, that is, the main path of the app, we read in the contents of this CSV file on line 18. These contents are stored in a pandas DataFrame, df. On line 21, we access the first 30 records of the file's contents and store that in a variable, data_csv. We run describe on the DataFrame and get a statistical summary of the data and store…

Contents