From 3e14b000b1cf84043ec89b31efbfbd6e4f281b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Bokros?= Date: Wed, 10 Jan 2018 16:31:36 +0100 Subject: [PATCH] Expose supervisor to python clients --- Dockerfile | 1 + lib/config/envvars.py | 3 +++ supervisord.conf | 3 +++ 3 files changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 3327b61..cdf7bf7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,7 @@ ENV PYTHONPATH=${TFW_LIB_DIR} COPY lib $TFW_LIB_DIR ENV TFW_SUPERVISORD_CONF="/etc/supervisor/supervisord.conf" +ENV TFW_SUPERVISOR_HTTP_PORT=9001 COPY supervisord.conf ${TFW_SUPERVISORD_CONF} ENV WEB_PORT=4242 diff --git a/lib/config/envvars.py b/lib/config/envvars.py index ab75fdb..6f997d8 100644 --- a/lib/config/envvars.py +++ b/lib/config/envvars.py @@ -3,3 +3,6 @@ import os PUBLISHER_PORT = os.getenv('PUBLISHER_PORT', 7654) RECEIVER_PORT = os.getenv('RECEIVER_PORT', 8765) WEB_PORT = os.getenv('WEB_PORT', 4242) +SUPERVISOR_HTTP_PORT = os.getenv('TFW_SUPERVISOR_PORT', 9001) + +SUPERVISOR_HTTP_URI = 'http://localhost:{}'.format(SUPERVISOR_HTTP_PORT) diff --git a/supervisord.conf b/supervisord.conf index 3a1973c..ca03c25 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -7,6 +7,9 @@ pidfile = /tmp/supervisord.pid [unix_http_server] file=/tmp/supervisor.sock +[inet_http_server] +port = 127.0.0.1:%(ENV_TFW_SUPERVISOR_HTTP_PORT)s + [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface