diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..94a93c2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# start by pulling the python image +FROM python:3.8-alpine + +# copy the requirements file into the image +COPY ./requirements.txt /app/requirements.txt + +# switch working directory +WORKDIR /app + +# install the dependencies and packages in the requirements file +RUN pip install -r requirements.txt + +# copy every content from the local file to the image +COPY ./app.py /app +COPY ./templates/index.html /app/templates/index.html +COPY ./static/favicon.ico /app/static/favicon.ico + +# configure the container to run in an executed manner +ENTRYPOINT [ "python" ] + +CMD ["app.py" ] \ No newline at end of file diff --git a/app.py b/app.py index d3b6f31..224db57 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,5 @@ -from flask import Flask, render_template, request, session +import os +from flask import Flask, render_template, request, session, send_from_directory from flask_bootstrap import Bootstrap app = Flask(__name__) @@ -7,6 +8,7 @@ Bootstrap(app) gesamtwert = 0 change = 0 +given = 0 sum = "" item1 = 0 item2 = 0 @@ -17,7 +19,7 @@ item6 = 0 @app.route("/", methods=["GET", "POST"]) def index(): - global gesamtwert, item1, item2, item3, item4, item5, item6, sum, givenfloat, change + global gesamtwert, item1, item2, item3, item4, item5, item6, sum, givenfloat, change, given if request.method == "POST": # wert = float(request.form["wert"]) @@ -79,5 +81,10 @@ def index(): item6=session.get('item6', 0), ) +@app.route('/favicon.ico') +def favicon(): + return send_from_directory(os.path.join(app.root_path, 'static'), + 'favicon.ico', mimetype='image/vnd.microsoft.icon') + if __name__ == "__main__": - app.run(debug=True, host="192.168.177.24") \ No newline at end of file + app.run(debug=True, host='0.0.0.0') \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a8f81e7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +Flask==3.0.3 +Flask-Bootstrap==3.3.7.1 +requests==2.32.2 diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..c41da86 Binary files /dev/null and b/static/favicon.ico differ diff --git a/templates/favicon.ico b/templates/favicon.ico deleted file mode 100644 index 9fea1e6..0000000 Binary files a/templates/favicon.ico and /dev/null differ