diff --git a/Dockerfile b/Dockerfile index 101b340..0b33e24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ RUN pip install flask-restx==1.3.0 WORKDIR /root COPY thermostat.py /root/ ENV FLASK_APP thermostat.py -ENTRYPOINT ["/usr/bin/gunicorn", "thermostat:app"] +ENTRYPOINT ["/usr/bin/gunicorn", "thermostat:gunicorn_app"] diff --git a/thermostat.py b/thermostat.py index fa14692..9b1c1d4 100755 --- a/thermostat.py +++ b/thermostat.py @@ -388,6 +388,7 @@ xprint('toto') t1 = Thread(target=thermostat_loop) #t1.daemon = True t1.start() +gunicorn_app = app t1.join() exit(0) # app.run(host='0.0.0.0', port=3002)