Docker Webapp using JavaScript and Python

Task-Description

Rishabh
2 min readJun 25, 2021

Creating an app which will help the user to run all the docker commands like:

🎯docker images
🎯docker ps
🎯docker run
🎯docker rm -f
🎯docker start
🎯docker stop

Pre-requisite:

  1. Install HTTPD software and enable it’s service.
  2. Install Docker-ce and enable it’s service.
  3. Internet connectivity

Steps to be followed:

  1. Enable httpd service: “systemctl start httpd”
  2. Stop firewalld service: “systemctl stop firewalld”
  3. Stopping Selinux services using: “setenforce 0”
  4. Add Docker to apache’s groups for permission as we need to run it as a Backend server.
  5. Add Apache to sudoer’s config file
  6. Adding “index.html” code to the “/var/www/html”
  7. Adding python backend CGI-code to the “/var/www/cgi-bin”
  8. Make the python file executable: “chmod +x <filename>”
  9. Finally accessing your webapp via IP with the help of Browser.

Now let’s get started:

Step-1: Starting the httpd, Stopping the firewall and disabling the selinux:

>> systemctl stop firewalld
>> systemctl start httpd
>> setenforce 0

Step-2: Add the apache to docker group.

>> vim /etc/group
>> docker:x:<someumber>:apache
Above is Important for permission purpose.

Step-3: Adding the apache to Sudoers config file.

>> vim /etc/sudoers
>> apache ALL:(ALL) NOPASSWD : ALL

Step-4: Add the front-end code to the webserver.

>> Go to /var/www/html
>> Create a file name “index.html”
And Add the following code to it!!

Step-5: Adding Backend-server code

>> Go to /var/www/cgi-bin
>> create a file named dockerps.py
And add the Following code to it!!

Step-6: Finally go the IP and you will see you DockerAPP with 100% functionality.

Hope you Like it, Keep on learning and keep on Improving…⚡

LinkedIN: https://www.linkedin.com/in/rishabh-465a85185/
Github: https://github.com/Rishbah-76/dockerwebApp_Javascript

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Rishabh
Rishabh

Written by Rishabh

Student from B.tech 2nd Year, A proud ARTH learner, love new technologies, Curious about many thing, likes to explore places, love eating pizza and much more.

No responses yet

Write a response