From 7bf3cd13a7b51dde4ed6773e4c2e5e65add41bb8 Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Fri, 7 Jun 2024 00:19:27 +0200 Subject: [PATCH] Test shutdown. --- Dockerfile | 3 +-- entrypoint.sh | 3 --- thermostat.py | 3 +++ 3 files changed, 4 insertions(+), 5 deletions(-) delete mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index ba53944..d6addfc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100755 index dfb5d2b..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -exec flask run diff --git a/thermostat.py b/thermostat.py index f3cf5b1..a72e4e7 100644 --- a/thermostat.py +++ b/thermostat.py @@ -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')