mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 09:11:32 +00:00
Handle starting TFWServer in baseimage
This commit is contained in:
parent
708c920784
commit
7c0e6d49bc
@ -37,6 +37,7 @@ ENV PYTHONPATH="/usr/local/lib" \
|
||||
TFW_LIB_DIR="/usr/local/lib/" \
|
||||
TFW_TERMINADO_DIR="/tmp/terminado_server" \
|
||||
TFW_FRONTEND_DIR="/srv/frontend" \
|
||||
TFW_SERVER_DIR="/srv/.tfw" \
|
||||
TFW_HISTFILE="/home/${AVATAO_USER}/.bash_history" \
|
||||
PROMPT_COMMAND="history -a"
|
||||
|
||||
@ -45,13 +46,15 @@ RUN echo "export HISTFILE=${TFW_HISTFILE}" >> /tmp/bashrc &&\
|
||||
cat /tmp/bashrc >> /home/${AVATAO_USER}/.bashrc
|
||||
|
||||
COPY supervisor/supervisord.conf ${TFW_SUPERVISORD_CONF}
|
||||
COPY supervisor/components/ ${TFW_SUPERVISORD_COMPONENTS}
|
||||
COPY nginx/nginx.conf ${TFW_NGINX_CONF}
|
||||
COPY nginx/default.conf ${TFW_NGINX_DEFAULT}
|
||||
COPY nginx/components/ ${TFW_NGINX_COMPONENTS}
|
||||
COPY lib LICENSE ${TFW_LIB_DIR}
|
||||
COPY supervisor/tfw_server.py ${TFW_SERVER_DIR}/
|
||||
|
||||
RUN for dir in "${TFW_LIB_DIR}"/{tfw,tao,envvars} "/etc/nginx" "/etc/supervisor"; do \
|
||||
chown -R root:root "$dir" && chmod -R 700 "$dir"; \
|
||||
chown -R root:root "$dir" && chmod -R 700 "$dir"; \
|
||||
done
|
||||
|
||||
ONBUILD ARG BUILD_CONTEXT="solvable"
|
||||
|
4
supervisor/components/tfw_server.conf
Normal file
4
supervisor/components/tfw_server.conf
Normal file
@ -0,0 +1,4 @@
|
||||
[program:tfwserver]
|
||||
user=root
|
||||
directory=%(ENV_TFW_SERVER_DIR)s
|
||||
command=python3 tfw_server.py
|
9
supervisor/tfw_server.py
Normal file
9
supervisor/tfw_server.py
Normal file
@ -0,0 +1,9 @@
|
||||
from tornado.ioloop import IOLoop
|
||||
|
||||
from tfw.networking import TFWServer
|
||||
from tfw.config import TFWENV
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
TFWServer().listen(TFWENV.WEB_PORT)
|
||||
IOLoop.instance().start()
|
Loading…
Reference in New Issue
Block a user