Docker Web Portal using JavaScript and Python CGI

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.

All CGI Codes

Features of the Website:

  1. Launch a Container
  2. Stop a Container
  3. Remove a Container
  4. List all available images
  5. List all containers with status
  6. A Scale to keep a track of how many containers are launched on the server!

Video Demo

Do watch this short 2 min video

Wait for the Docker to move on the scale 😉.

This project is done along with Daksh Jain.
Do share your views. You could reach me out on LinkedIn.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Sidekiq-ifying Emails at Reflektive

Sharpness of C Sharp AKA C#

Creating a User Driven in-line autocomplete

Using the Payment Request API with moltin

Prototyping Week 5

Software Environment: Deploying project to website

The Beginning -My HNGi8 Internship Program

Using Jira to build a Release Management Framework at Simplilearn — Part II

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
khushi thareja

khushi thareja

More from Medium

How to access User’s clipboard in JavaScript

Creating image using Numpy and Arrays

Django Function-Based View of Update Functionality

CS50w — Lecture 3 Django