From 3734fa22778a8f2647d33e7074c1b081726df095 Mon Sep 17 00:00:00 2001 From: tebarius Date: Wed, 1 Nov 2023 16:53:41 +0100 Subject: [PATCH] auf python-slim umgestellt --- .idea/dbnavigator.xml | 9 ++++ .idea/misc.xml | 3 ++ .idea/workspace.xml | 100 ++++++++++++++++++++++++++++++++++++++---- Docker-Flask-QR.iml | 4 ++ Dockerfile | 19 ++++++-- Dockerfile-RasPi | 10 +++-- Flask-QR.py | 3 ++ requirements.txt | 2 + templates/index.html | 18 +++++++- templates/qr.html | 15 ++++++- 10 files changed, 164 insertions(+), 19 deletions(-) diff --git a/.idea/dbnavigator.xml b/.idea/dbnavigator.xml index a9cfe74..0412f47 100644 --- a/.idea/dbnavigator.xml +++ b/.idea/dbnavigator.xml @@ -1,5 +1,14 @@ + + + + + + + + + diff --git a/.idea/misc.xml b/.idea/misc.xml index 639900d..0dda005 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,8 @@ + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 743a99b..b4a4416 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,30 +1,101 @@ + + - + + + + + + + + + + + + + + + - + + + { + "associatedIndex": 4 +} - { + "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/Dockerfile-RasPi" } -}]]> +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -36,4 +107,15 @@ + + + \ No newline at end of file diff --git a/Docker-Flask-QR.iml b/Docker-Flask-QR.iml index 55d8595..5b1310a 100644 --- a/Docker-Flask-QR.iml +++ b/Docker-Flask-QR.iml @@ -6,4 +6,8 @@ + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b746629..2de38e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,17 @@ -FROM ubuntu:latest -LABEL authors="tebarius" +FROM python:slim -ENTRYPOINT ["top", "-b"] \ No newline at end of file +LABEL authors="tebarius" +LABEL version="1.0" +LABEL description="Simple QR-Code-Generator-Server" + +WORKDIR /app +RUN mkdir templates +COPY ./templates /app/templates/ +COPY ./Flask-QR.py ./requirements.txt /app/ + +#RUN pip install --upgrade pip +RUN pip install --trusted-host pypi.python.org -r requirements.txt + +EXPOSE 80 + +CMD ["python", "Flask-QR.py"] \ No newline at end of file diff --git a/Dockerfile-RasPi b/Dockerfile-RasPi index b8c7a0d..50ecc8a 100644 --- a/Dockerfile-RasPi +++ b/Dockerfile-RasPi @@ -1,4 +1,4 @@ -FROM python:3.9.18-slim +FROM python:slim LABEL authors="tebarius" LABEL version="1.0" @@ -6,9 +6,13 @@ LABEL description="Simple QR-Code-Generator-Server" WORKDIR /app -COPY ./templates ./Flask-QR.py ./requirements.txt /app/ +RUN mkdir templates +COPY ./templates /app/templates/ +COPY ./Flask-QR.py ./requirements.txt /app/ -RUN pip install --upgrade pip +RUN apt-get update && apt-get install -y zlib1g-dev libjpeg-dev libpng-dev gcc +#RUN python -m pip install --upgrade pip +#RUN python -m pip install --upgrade pillow RUN pip install --trusted-host pypi.python.org -r requirements.txt EXPOSE 80 diff --git a/Flask-QR.py b/Flask-QR.py index e09f144..76229ef 100644 --- a/Flask-QR.py +++ b/Flask-QR.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python3 +# notwendige pakete via pip: +# pip install Flask Flask-QRcode from flask import Flask, render_template, request from flask_qrcode import QRcode diff --git a/requirements.txt b/requirements.txt index e69de29..6056ed4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1,2 @@ +Flask +Flask-QRcode \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index a4963b6..6211232 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,9 +1,23 @@ - + QR-Code-Generator - +

QRCode-Generator

+

+ +

+
+
+ +

+ + +
+ + + + diff --git a/templates/qr.html b/templates/qr.html index 22f2621..09784b9 100644 --- a/templates/qr.html +++ b/templates/qr.html @@ -1,9 +1,20 @@ - + QR-Code-Generator - +

QRCode-Generator

+

+ folgender Text wurde im QR-Code codiert:
+ {{ data }}
+
+ + QR-Code für {{ data }} +

+

+Noch einmal bitte! +

+