From f78a365e752fa743862f6638820da56b3ce89635 Mon Sep 17 00:00:00 2001 From: Till Tomczak Date: Thu, 20 Feb 2025 00:17:50 +0100 Subject: [PATCH] anpassungen an kundenserver --- Dashboard_V2/Dockerfile | 14 ++++++++++++++ Dashboard_V2/app.py | 4 ++-- Dashboard_V2/docker-compose.yml | 17 +++++++++++++++++ Dashboard_V2/requirements.txt | 5 +++-- 4 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 Dashboard_V2/Dockerfile create mode 100644 Dashboard_V2/docker-compose.yml diff --git a/Dashboard_V2/Dockerfile b/Dashboard_V2/Dockerfile new file mode 100644 index 0000000..053ebc7 --- /dev/null +++ b/Dashboard_V2/Dockerfile @@ -0,0 +1,14 @@ +FROM python:3.9-slim + +WORKDIR /app + +# Abhängigkeiten kopieren und installieren +COPY requirements.txt requirements.txt +RUN pip install --no-cache-dir -r requirements.txt + +# Anwendungscode kopieren +COPY . . + +EXPOSE 9559 + +CMD ["python", "app.py"] diff --git a/Dashboard_V2/app.py b/Dashboard_V2/app.py index 463dda6..0a05787 100644 --- a/Dashboard_V2/app.py +++ b/Dashboard_V2/app.py @@ -12,7 +12,7 @@ EMAIL_SENDER = "clickcandit@gmail.com" EMAIL_PASSWORD = "iuxexntistlwilhl" app = Flask(__name__) -app.secret_key = "SUPER_SECRET_KEY" # Bitte anpassen +app.secret_key = "fiudsh9uw4hefjsefnjdsdh" DATABASE = 'clickcandit.db' @@ -793,4 +793,4 @@ def get_weather(city): # ------------------------------------------------------------ if __name__ == '__main__': init_db() - app.run(debug=True) + app.run(debug=True, port=9559, host="0.0.0.0") diff --git a/Dashboard_V2/docker-compose.yml b/Dashboard_V2/docker-compose.yml new file mode 100644 index 0000000..ff55611 --- /dev/null +++ b/Dashboard_V2/docker-compose.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + web: + build: . + ports: + - "9559:9559" + volumes: + - ./clickcandit.db:/app/clickcandit.db + - ./:/app + environment: + - FLASK_ENV=production + - SMTP_SERVER=smtp.gmail.com + - SMTP_PORT=465 + - EMAIL_SENDER=clickcandit@gmail.com + - EMAIL_PASSWORD=iuxexntistlwilhl + - APP_SECRET_KEY=fiudsh9uw4hefjsefnjdsdh + restart: always diff --git a/Dashboard_V2/requirements.txt b/Dashboard_V2/requirements.txt index fd7575e..cd44297 100644 --- a/Dashboard_V2/requirements.txt +++ b/Dashboard_V2/requirements.txt @@ -1,2 +1,3 @@ -Flask -Werkzeug \ No newline at end of file +Werkzeug +Flask>=2.2 +gunicorn