Building the container

The container is based on the tensorflow/tensorflow:latest-py3 container, which can be found at https://hub.docker.com/r/tensorflow/tensorflow/tags/. This container supports Python 3 and TensorFlow and is customized with some additional dependencies such as Keras, Pandas, SciPy, Flask, and NGINX. We need to copy our algorithms on the container. For this exercise, we will use the code developed in Chapter 14, Implementing a Digital Twin - Advanced Analytics. The training steps have been defined in the train file. The most important part of the algorithm is as follows:

  1. The first part file of the train file defines the import:
#!/usr/bin/env python3…import pandas as pdimport numpy as npfrom keras.models import Sequential ...

Get Hands-On Industrial Internet of Things now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.