Эх сурвалжийг харах

增加Supervisor管理进程

rubyangxg 4 жил өмнө
parent
commit
496d28b823
3 өөрчлөгдсөн 33 нэмэгдсэн , 2 устгасан
  1. 23 1
      Dockerfile
  2. 3 0
      build.sh
  3. 7 1
      readme.txt

+ 23 - 1
Dockerfile

@@ -4,4 +4,26 @@ COPY . /container
 RUN /container/build.sh
 
 ENV LD_PRELOAD /usr/local/lib/faketime/libfaketime.so.1
-ENV FAKETIME_DONT_FAKE_MONOTONIC 1
+ENV FAKETIME_DONT_FAKE_MONOTONIC 1
+
+# 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=9999
+# 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 echo -e "[unix_http_server]\nfile=${SUPERVISORD_TMP_CONF}/supervisor.sock\n[inet_http_server]\nport=${SUPERVISORD_WEB_IP}:${SUPERVISORD_WEB_PORT}\nusername=${SUPERVISORD_WEB_ACCOUNT}\npassword=${SUPERVISORD_WEB_PASSWORD}\n[supervisord]\nlogfile=${SUPERVISORD_TMP_CONF}/supervisord.log\nlogfile_maxbytes=50MB\nlogfile_backups=10\nloglevel=info\npidfile=${SUPERVISORD_TMP_CONF}/supervisord.pid\nnodaemon=false\nminfds=1024\nminprocs=200\n[supervisorctl]\nserverurl=unix://${SUPERVISORD_TMP_CONF}/supervisor.sock\n[program:sshd]\ncommand=/usr/sbin/sshd -D\n[include]\nfiles = ${SUPERVISORD_INCLUDE_FILE}/*.ini" > ${SUPERVISORD_CONF}
+
+EXPOSE 9999
+CMD ["/usr/bin/supervisord", "--configuration=/etc/supervisord.conf"]

+ 3 - 0
build.sh

@@ -33,6 +33,8 @@ apk add --update bash python3 py-yaml openssl curl net-tools iproute2 bash-compl
 #install make env
 apk add --update alpine-sdk
 
+apk add --update supervisor
+
 cp "/usr/share/zoneinfo/Asia/Shanghai" /etc/localtime
 echo "Asia/Shanghai" >/etc/timezone
 
@@ -45,3 +47,4 @@ touch ~/.faketimerc
 
 rm -rf /var/cache/apk/*
 rm -rf /tmp/* /var/tmp/*
+

+ 7 - 1
readme.txt

@@ -1,3 +1,9 @@
 docker build -t hub.evbj.easou.com/pro/base-alpine:latest -t hub.evbj.easou.com/pro/base-alpine:v1.0 .
+docker build -t hub.evbj.easou.com/pro/base-alpine:v1.1 .
 docker push hub.evbj.easou.com/pro/base-alpine:v1.0
-docker push hub.evbj.easou.com/pro/base-alpine:latest
+docker push hub.evbj.easou.com/pro/base-alpine:latest
+
+
+docker build --tag=easou-base-alpine .
+docker tag easou-base-alpine hub.evbj.easou.com/pro/base-alpine:v1.1
+docker push hub.evbj.easou.com/pro/base-alpine:v1.1