Supervisor working in docker

Updated 5 January 2023

You all may know that docker runs a single process when it is launched and we need to run multiple processes at its launching time if we are building an image through a docker file.

While launching the container, we can use a tool to run multiple processes which is ‘supervisor’.

Now the question arises that what a supervisor is.

A supervisor is a tool through which we can run multiple processes while building the docker image, in short, it manages multiple processes in our container.

If you want to run more than one process in your container, just install the supervisor through the docker file and run all the commands through it.

In my last blog, I was building an image called lamp with Prestashop through a docker file where I used a supervisor to run multiple processes like starting apache2, MySQL, and many other services at its startup time, I ran all the services in that container through the supervisor tool.

It is a very useful tool that reduces the time while starting a process in the container.

If you want the container and all the services to run automatically then just install the supervisor tool in your docker file and then you will be able to run multiple processes in your container.

Now the question arises of how the supervisor tool works.

Before I tell you how it works just have a look at my docker file, I am sure you will get to know how the supervisor is working.

If you see the 12th line, I am installing supervisor in it & then I made a directory in which all the logs will be generated and stored.

Now in the 14th line, I am moving a conf file – supervisor.conf on the path – (/etc/supervisor/conf.d/supervisord.conf), this file contains all the commands required to launch the container.

To know what all commands I stored in supervisord.conf just go and download it by hitting the command:-

To install the docker, please follow the below link:-

http://cloudkul.com/blog/start-your-journey-with-docker

or if you don’t want to install docker now and want to see all the files which I used in the docker file, you can get it also from GitHub, just click on the link given below:-

https://github.com/webkul/LAMP-WITH-PRESTASHOP

You will get all the files that I used in the docker file to build the container, you just download it and make it to use according to your requirement…:)

If still you have any doubts or queries about it, feel free to ask by replying to this blog. I will surely give you all the solutions to your problems….:)

FOR ANY TYPE OF QUERY OR HELP, KINDLY CONTACT US

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project






    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home