From ca1ed961d4d4532e1cbe831bc1a26c228f27574a Mon Sep 17 00:00:00 2001 From: tebarius Date: Tue, 14 Nov 2023 14:25:51 +0100 Subject: [PATCH] =?UTF-8?q?ENV-Variable=20HTTP=5FMETHOD=20eingef=C3=BChrt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 62 +++++++--------------- Dockerfile | 6 +-- Dockerfile-RasPi | 6 +-- app/{Post-Flask-QR.py => POST-Flask-QR.py} | 0 readme.md | 5 +- 5 files changed, 27 insertions(+), 52 deletions(-) rename app/{Post-Flask-QR.py => POST-Flask-QR.py} (100%) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c81f81b..c95cfcc 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,35 +5,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + - { + "keyToString": { + "DefaultHtmlFileTemplate": "HTML File", + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "SHARE_PROJECT_CONFIGURATION_FILES": "true", + "ignore.virus.scanning.warn.message": "true", + "last_opened_file_path": "D:/mager/Documents/IntelliJ/Docker-Flask-QR/app/Post-Flask-QR.py", + "project.structure.last.edited": "Modules", + "project.structure.proportion": "0.15", + "project.structure.side.proportion": "0.2", + "settings.editor.selected.configurable": "preferences.keymap" } -}]]> +} @@ -117,7 +93,7 @@ - + - + diff --git a/Dockerfile b/Dockerfile index 1f07b7c..a09a4b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,6 @@ RUN pip install --trusted-host pypi.python.org -r requirements.txt EXPOSE 8002 -# with GET-REQUESTS -#CMD ["python", "GET-Flask-QR.py"] +ENV HTTP_METHOD POST -# the same with POST-REQUESTS -CMD ["python", "Post-Flask-QR.py"] \ No newline at end of file +CMD ["sh", "-c", "python ${HTTP_METHOD}-Flask-QR.py"] \ No newline at end of file diff --git a/Dockerfile-RasPi b/Dockerfile-RasPi index 82e0fbd..2c6c612 100644 --- a/Dockerfile-RasPi +++ b/Dockerfile-RasPi @@ -15,8 +15,6 @@ RUN pip install --trusted-host pypi.python.org -r requirements.txt EXPOSE 8002 -# with GET-REQUESTS -#CMD ["python", "GET-Flask-QR.py"] +ENV HTTP_METHOD POST -# the same with POST-REQUESTS -CMD ["python", "Post-Flask-QR.py"] \ No newline at end of file +CMD ["sh", "-c", "python ${HTTP_METHOD}-Flask-QR.py"] \ No newline at end of file diff --git a/app/Post-Flask-QR.py b/app/POST-Flask-QR.py similarity index 100% rename from app/Post-Flask-QR.py rename to app/POST-Flask-QR.py diff --git a/readme.md b/readme.md index 271c1ae..c746bc5 100644 --- a/readme.md +++ b/readme.md @@ -8,4 +8,7 @@ Dieses Programm benötigt Python und das Flask-Framework um einen kleinen Server ## Docker Es gibt 2 unterschiedliche Dockerfile's, da obwohl bei beiden python:slim als Basis genutzt wird, noch die Installation von ein paar packages zusätzlich notwendig ist, damit flask auch auf -dem RaspberryPi 3 via pip install integriert werden kann \ No newline at end of file +dem RaspberryPi 3 via pip install integriert werden kann + +## Enviroment-Variablen +- `HTTP_METHOD` GET oder POST (default: POST) \ No newline at end of file