From 8b7b5775f505012bc48e622a1a5359153f4528bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Sep 2023 09:52:13 +0000 Subject: [PATCH 1/4] Bump python from 3.11.3-bullseye to 3.11.5-bullseye Bumps python from 3.11.3-bullseye to 3.11.5-bullseye. --- updated-dependencies: - dependency-name: python dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f1f16b3..2d2283e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11.4-bullseye AS builder +FROM python:3.11.5-bullseye AS builder RUN apt-get update && apt-get install -y apt-transport-https curl gnupg \ && curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >/usr/share/keyrings/bazel-archive-keyring.gpg \ @@ -15,7 +15,7 @@ RUN ["bazel", "build", "//wgkex/broker:app"] RUN ["bazel", "build", "//wgkex/worker:app"] RUN ["cp", "-rL", "bazel-bin", "bazel"] -FROM python:3.11.3-bullseye +FROM python:3.11.5-bullseye WORKDIR /wgkex COPY --from=builder /wgkex/bazel /wgkex/ From 8ab2b81b420f580e01a62f45b2cbf6ed28e3f4d8 Mon Sep 17 00:00:00 2001 From: Annika Wickert Date: Mon, 18 Sep 2023 12:29:08 +0200 Subject: [PATCH 2/4] Use waitress instead of flask for prod --- wgkex/broker/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wgkex/broker/app.py b/wgkex/broker/app.py index e82497b..5001dc3 100644 --- a/wgkex/broker/app.py +++ b/wgkex/broker/app.py @@ -13,6 +13,7 @@ from flask_mqtt import Mqtt import paho.mqtt.client as mqtt_client +from waitress import serve from wgkex.config import config from wgkex.common import logger @@ -168,4 +169,4 @@ def is_valid_domain(domain: str) -> str: listen_host = listen_config.get("host") listen_port = listen_config.get("port") - app.run(host=listen_host, port=listen_port) + serve(app, host=listen_host, port=listen_port) From ac4d2a9f8ef6d1d331173adf28f92009c4e7a816 Mon Sep 17 00:00:00 2001 From: Annika Wickert Date: Mon, 18 Sep 2023 10:32:13 +0000 Subject: [PATCH 3/4] Add this stuff --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 2652652..b16dec7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ flask-mqtt pyroute2 PyYAML Flask +waitress # Common ipaddress From 4aabc325fa38d74bf7ef9f4d88dabe64696ea5a1 Mon Sep 17 00:00:00 2001 From: Annika Wickert Date: Mon, 18 Sep 2023 11:25:16 +0000 Subject: [PATCH 4/4] Also require waitress in bazel --- wgkex/broker/BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/wgkex/broker/BUILD b/wgkex/broker/BUILD index 316c91a..260fe45 100644 --- a/wgkex/broker/BUILD +++ b/wgkex/broker/BUILD @@ -9,6 +9,7 @@ py_binary( deps=[ requirement("flask"), requirement("flask-mqtt"), + requirement("waitress"), "//wgkex/config:config", ], )