Docker Webapp using JavaScript and Python
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:
- Install HTTPD software and enable it’s service.
- Install Docker-ce and enable it’s service.
- Internet connectivity
Steps to be followed:
- Enable httpd service: “systemctl start httpd”
- Stop firewalld service: “systemctl stop firewalld”
- Stopping Selinux services using: “setenforce 0”
- Add Docker to apache’s groups for permission as we need to run it as a Backend server.
- Add Apache to sudoer’s config file
- Adding “index.html” code to the “/var/www/html”
- Adding python backend CGI-code to the “/var/www/cgi-bin”
- Make the python file executable: “chmod +x <filename>”
- 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