From 6ff67e019030fb6ece9bdf6230f44ee85760c21c Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Sat, 6 Jul 2024 20:48:56 -0300 Subject: [PATCH] Added ping endpoint, lower resource usage --- runtimes/flask/Dockerfile.j2 | 2 +- runtimes/flask/template/funko.py.j2 | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/runtimes/flask/Dockerfile.j2 b/runtimes/flask/Dockerfile.j2 index 303dd99..75ee20f 100644 --- a/runtimes/flask/Dockerfile.j2 +++ b/runtimes/flask/Dockerfile.j2 @@ -18,5 +18,5 @@ USER app COPY --from=build /home/app/ . -CMD ["venv/bin/uwsgi", "--http", "0.0.0.0:3000", "--master", "-p", "4", "-w", "funko:app"] +CMD ["venv/bin/uwsgi", "--http", "0.0.0.0:3000", "--master", "-p", "1", "-w", "funko:app"] HEALTHCHECK {{ healthcheck_options }} CMD {{ healthcheck_command }} \ No newline at end of file diff --git a/runtimes/flask/template/funko.py.j2 b/runtimes/flask/template/funko.py.j2 index eeb8c38..d21b5f7 100644 --- a/runtimes/flask/template/funko.py.j2 +++ b/runtimes/flask/template/funko.py.j2 @@ -5,3 +5,7 @@ app = Flask("{{name}}") @app.route('/') def handle(req): return "Hello World from Flask!" + +@app.route('/ping') +def handle(req): + return "OK"