Docker uses supervisor to process management

Source: Internet
Author: User
Tags docker compose haproxy

Supervisor to manage multiple processes in a container. Use Supervisor to better control, manage, and restart the processes we want to run. Supervisor is a Process control system . it is a C/S system , It allows the user to monitor and control the class UNIX process of the system

configuration first creates a Dockerfile

Create a directory of Dockerfile

generate the key and create the Authorized_keys file.

Supervisor Configuration

The first paragraph supervsord configures the software itself and runs using the nodaemon parameter. nodaemon=true if it is

True, thesupervisord process will run in the foreground , default to false, That is, the daemon runs in the daemons.

/docker/apache directory Content list

Create image

start our Supervisor container .

verify SSH [email protected] -p port number No secrets

testing : Accessing the Web and ssh services provided by the container

2.Docker Compose Project

the compose project originates from the previous Fig project and is written in python code. the compose project is primarily used to orchestrate the deployment of Docker -based applications.

installation Docker-compose

install pip first #wget https://bootstrap.pypa.io/get-pip.py

re-install compose

View The version of Docker-compose and the use of commands.

we create a classic Web Project: A Haproxythat mounts three web containers

The Docker-haproxy directory, which is the Project working directory, in which you create two subdirectories: haproxy and Web.

#mkdir-P/root/docker-haproxy/{haproxy,web}

Create a docker-compose.yml file under the /root/docker-haproxy/ directory

Create the haproxy Master profile in the/root/docker-haproxy/haproxy directory haproxy.cfg

storing Web Site page Files in the /root/docker-haproxy/web directory

Docker-compose.yml File

Haproxy master configuration file haproxy.cfg

Cfg

Web Site Web page

Haproxy directory :

in which a haproxy.cfg file is generated

Docker-compose.yml

Write The docker-compose.yml file, which is the main template file used by compose. The content is very simple and means

set 3 Web containers, and 1 haproxy containers.


To run the Compose project :

Execute docker-compose up-d in the Docker-haproxy directory to launch your app

To view container startup conditions

Open the browser native to this machine I

Docker uses supervisor to process management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.