Configure WebServer and Python Interpreter using Container — Docker

kanav Gupta
Nov 13, 2020

Tasks:

  • Configure WebServer on the top of Docker Container
  • Setting up Python Interpreter and running Python Code on Docker Container

1- Let’s configure the WebServer on the docker container…

For launching a new docker containter, command is…

docker run it --name os_name image:tag

We can check it by using command docker ps also.

configure WebServer now…

  • 1st step: Install httpd software for launching the webserver.

yum install httpd -y

  • 2nd Step: Put your code in /var/www/html
  • 3rd Step: Start the httpd services…

Here if you try to start services using systemctl command, it failed because docker container doesn’t provide systemctl command.

So here we directly run exec file location to run httpd server…

/usr/sbin/httpd

2- Setting up Python Interpreter and running Python Code on Docker Container…

For this, we can normally launch one OS and install python3 software to setup Python Interpreter…

And Now you can run your python code here…

--

--