zoukankan      html  css  js  c++  java
  • 使用docker构建supervisor全步骤

    1.使用docker build 命令基于Dockerfile文件进行构建supervisor镜像,命令:docker build -t supervisor镜像名 Dockerfile文件放置的位置
    Dockerfile文件如下:

    FROM centos
    MAINTAINER phonecom<18819470615@163.com>
    
    # supervisor配置文件路径
    ENV SUPERVISORD_CONF=/etc/supervisord.conf
    # supervisor临时文件路径(日志文件、sock文件、pid文件)
    ENV SUPERVISORD_TMP_CONF=/tmp/supervisor
    # supervisor程序块文件路径,即是[program]块
    ENV SUPERVISORD_INCLUDE_FILE=/etc/supervisordfile
    # web管理界面的IP
    ENV SUPERVISORD_WEB_IP=*
    # web管理界面的PORT
    ENV SUPERVISORD_WEB_PORT=9001
    # web管理界面的账号
    ENV SUPERVISORD_WEB_ACCOUNT=admin
    # web管理界面的密码
    ENV SUPERVISORD_WEB_PASSWORD=adminpass
    
    RUN mkdir -p ${SUPERVISORD_TMP_CONF}
    RUN mkdir -p ${SUPERVISORD_INCLUDE_FILE}
    
    RUN yum -y update
    RUN yum install -y python-setuptools wget telinit
    RUN wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py -O |python
    RUN easy_install supervisor
    RUN echo -e "[unix_http_server]
    file=${SUPERVISORD_TMP_CONF}/supervisor.sock
    [inet_http_server]
    port=${SUPERVISORD_WEB_IP}:${SUPERVISORD_WEB_PORT}
    username=${SUPERVISORD_WEB_ACCOUNT}
    password=${SUPERVISORD_WEB_PASSWORD}
    [supervisord]
    logfile=${SUPERVISORD_TMP_CONF}/supervisord.log
    logfile_maxbytes=50MB
    logfile_backups=10
    loglevel=info
    pidfile=${SUPERVISORD_TMP_CONF}/supervisord.pid
    nodaemon=false
    minfds=1024
    minprocs=200
    [supervisorctl]
    serverurl=unix://${SUPERVISORD_TMP_CONF}/supervisor.sock
    [include]
    files = ${SUPERVISORD_INCLUDE_FILE}/*.ini" > ${SUPERVISORD_CONF}
    
    USER root
    EXPOSE 22 80 9001
    
    RUN /usr/sbin/init &
    RUN /usr/sbin/telinit &
    

    2.使用docker-compose.yml文件进行启动容器,命令:docker-compose up -d
    docker-compose.yml文件如下

    version: "2"
    services:
      supervisor:
        image: phonecom/supervisor # 这里是构建的镜像名
        ports:
          - "127.0.0.1:9001:9001"
        privileged: true
        command: 
          - /usr/bin/bash
          - -c 
          - |
            supervisord -c /etc/supervisord.conf
            while true;do sleep 100;done
    
  • 相关阅读:
    ClientDataSet 心得
    TClientDataSet中关于TField、TFieldDef动态创立字段的应用
    Delphi CxGrid 汇总(4)
    Delphi CxGrid 汇总(3)
    Delphi CxGrid 汇总(2)
    Delphi cxGrid使用汇总(一)
    修改后的SQL分页存储过程,利用2分法,支持排序
    字符串操作之格式化
    关于 cxGrid 的过滤问题
    cxGrid实现取消过滤和排序后定位到首行(单选和多选)
  • 原文地址:https://www.cnblogs.com/phonecom/p/10804633.html
Copyright © 2011-2022 走看看