For the backend, we would be using the PythonCGI. We are going to take the input from the client (from the web portal) & the code runs particular docker commands and gives the output back to JS functions that display it on the webpage.
My website is running in a Apache webserver on RHEL8. So all these files are present in the /var/www/html folder.
Let us have a look at a JS function.
Here XMLHttpRequest() function is used which can send and get result over http requests.
.send() function sends the request to the given URL — which is a CGI code.
.onload() gets the data and I am presenting it in the alert dialog.
The backend files are present in the /var/www/cgi-bin folder. These files run the backend docker commands that give output back on the screen.
Features of the Website:
- Launch a Container
- Stop a Container
- Remove a Container
- List all available images
- List all containers with status
- A Scale to keep a track of how many containers are launched on the server!
Do watch this short 2 min video
Wait for the Docker to move on the scale 😉.