Test shutdown.

This commit is contained in:
yohan 2024-06-07 00:19:27 +02:00
parent e6f7261d67
commit 7bf3cd13a7
3 changed files with 4 additions and 5 deletions

View File

@ -7,7 +7,6 @@ ENV PIP_BREAK_SYSTEM_PACKAGES 1
RUN pip install flask-restx==1.3.0
WORKDIR /root
COPY thermostat.py /root/
COPY entrypoint.sh /root/
ENV FLASK_APP thermostat.py
STOPSIGNAL SIGINT
ENTRYPOINT ["/root/entrypoint.sh"]
ENTRYPOINT ["/root/thermostat.py"]

View File

@ -1,3 +0,0 @@
#!/bin/bash
exec flask run

View File

@ -1,3 +1,4 @@
#!/usr/bin/env python3
from flask import Flask, request
from flask_restx import Api, Resource, fields
from functools import wraps
@ -383,6 +384,8 @@ def thermostat_loop():
time.sleep(load_shedder_interval)
logging.info("====== Ended successfully ======")
if __name__ == '__main__':
#t1 = Thread(target=thermostat_loop)
#t1.daemon = True
#t1.start()
app.run(host='0.0.0.0')