mirror of
https://github.com/tebarius/Docker-Flask-QR.git
synced 2025-12-20 22:23:30 +01:00
auf python-slim umgestellt
This commit is contained in:
9
.idea/dbnavigator.xml
generated
9
.idea/dbnavigator.xml
generated
@@ -1,5 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DBNavigator.Project.DatabaseBrowserManager">
|
||||
<autoscroll-to-editor value="false" />
|
||||
<autoscroll-from-editor value="true" />
|
||||
<show-object-properties value="true" />
|
||||
<loaded-nodes />
|
||||
</component>
|
||||
<component name="DBNavigator.Project.DatabaseFileManager">
|
||||
<open-files />
|
||||
</component>
|
||||
<component name="DBNavigator.Project.Settings">
|
||||
<connections />
|
||||
<browser-settings>
|
||||
|
||||
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
@@ -1,5 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.12 (Docker-Flask-QR)" />
|
||||
</component>
|
||||
<component name="ProjectRootManager">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
|
||||
100
.idea/workspace.xml
generated
100
.idea/workspace.xml
generated
@@ -1,30 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="3fdfc273-527d-4717-bd6d-4ba98fba7555" name="Changes" comment="" />
|
||||
<list default="true" id="3fdfc273-527d-4717-bd6d-4ba98fba7555" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/dbnavigator.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dbnavigator.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Docker-Flask-QR.iml" beforeDir="false" afterPath="$PROJECT_DIR$/Docker-Flask-QR.iml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Dockerfile" beforeDir="false" afterPath="$PROJECT_DIR$/Dockerfile" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Dockerfile-RasPi" beforeDir="false" afterPath="$PROJECT_DIR$/Dockerfile-RasPi" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Flask-QR.py" beforeDir="false" afterPath="$PROJECT_DIR$/Flask-QR.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/requirements.txt" beforeDir="false" afterPath="$PROJECT_DIR$/requirements.txt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/templates/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/index.html" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/templates/qr.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/qr.html" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="Python Script" />
|
||||
<option value="HTML File" />
|
||||
<option value="Dockerfile" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo"><![CDATA[{
|
||||
"associatedIndex": 4
|
||||
}]]></component>
|
||||
<component name="MarkdownSettingsMigration">
|
||||
<option name="stateVersion" value="1" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 4
|
||||
}</component>
|
||||
<component name="ProjectId" id="2XWrX9sCJFSR4JSbdK3QdicYBvo" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true"
|
||||
<component name="PropertiesComponent">{
|
||||
"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"
|
||||
}
|
||||
}]]></component>
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="D:\mager\Documents\IntelliJ\Docker-Flask-QR" />
|
||||
<recent name="D:\mager\Documents\IntelliJ\Docker-Flask-QR\templates" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="D:\mager\Documents\IntelliJ\Docker-Flask-QR\templates" />
|
||||
<recent name="D:\mager\Documents\IntelliJ\Docker-Flask-QR" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager" selected="Docker.Dockerfile-Raspi">
|
||||
<configuration name="Dockerfile-Raspi" type="docker-deploy" factoryName="dockerfile" temporary="true" server-name="Docker-RasPi">
|
||||
<deployment type="dockerfile">
|
||||
<settings>
|
||||
<option name="imageTag" value="flask-qrcode-gen:latest" />
|
||||
<option name="containerName" value="flask-qrcode-gen" />
|
||||
<option name="portBindings">
|
||||
<list>
|
||||
<DockerPortBindingImpl>
|
||||
<option name="containerPort" value="80" />
|
||||
<option name="hostPort" value="8002" />
|
||||
</DockerPortBindingImpl>
|
||||
</list>
|
||||
</option>
|
||||
<option name="sourceFilePath" value="Dockerfile-RasPi" />
|
||||
</settings>
|
||||
</deployment>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration default="true" type="docker-deploy" factoryName="dockerfile" temporary="true">
|
||||
<deployment type="dockerfile">
|
||||
<settings />
|
||||
</deployment>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Docker.Dockerfile-Raspi" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
@@ -36,4 +107,15 @@
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -6,4 +6,8 @@
|
||||
<orderEntry type="jdk" jdkName="Python 3.12 (Docker-Flask-QR)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="PackageRequirementsSettings">
|
||||
<option name="versionSpecifier" value="Don't specify version" />
|
||||
<option name="removeUnused" value="true" />
|
||||
</component>
|
||||
</module>
|
||||
19
Dockerfile
19
Dockerfile
@@ -1,4 +1,17 @@
|
||||
FROM ubuntu:latest
|
||||
LABEL authors="tebarius"
|
||||
FROM python:slim
|
||||
|
||||
ENTRYPOINT ["top", "-b"]
|
||||
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"]
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Flask
|
||||
Flask-QRcode
|
||||
@@ -1,9 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>QR-Code-Generator</title>
|
||||
</head>
|
||||
<body>
|
||||
<img src="{{ data|qrcode }}">
|
||||
<H1 style="text-align: center; background-color: #eee; border-radius: .5em;">QRCode-Generator</H1>
|
||||
<p style="text-align: center;">
|
||||
|
||||
</p>
|
||||
<form action="qr.html" style="text-align: center">
|
||||
<label for="qr" style="font-size: 2em;">Was soll im QR-Code stehen?</label><br>
|
||||
<input type="text" name="qr" id="qr" size="60" maxlength="120">
|
||||
<br><br>
|
||||
<button type="reset">Eingaben zurücksetzen</button>
|
||||
<button type="submit">Eingaben absenden</button>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>QR-Code-Generator</title>
|
||||
</head>
|
||||
<body>
|
||||
<img src="{{ url|qrcode }}">
|
||||
<H1 style="text-align: center; background-color: #eee; border-radius: .5em;">QRCode-Generator</H1>
|
||||
<p style="text-align: center; font-size: 2em;">
|
||||
<b>folgender Text wurde im QR-Code codiert:</b><br>
|
||||
{{ data }} <br>
|
||||
<br>
|
||||
<!--suppress HtmlUnknownTarget -->
|
||||
<img src="{{ data|qrcode }}" alt="QR-Code für {{ data }}">
|
||||
</p>
|
||||
<p style="text-align: center; font-size: 1.5em;">
|
||||
<a href="./">Noch einmal bitte!</a>
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user