From 5fab7b687548ce60149fa7389613db80ce10b67f Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 12 Dec 2024 14:51:19 +0400 Subject: [PATCH] Add application to deploy during course --- devops/flask_app/README.md | 8 ++++++++ devops/flask_app/main.py | 8 ++++++++ devops/flask_app/requirements.txt | 1 + 3 files changed, 17 insertions(+) create mode 100644 devops/flask_app/README.md create mode 100644 devops/flask_app/main.py create mode 100644 devops/flask_app/requirements.txt diff --git a/devops/flask_app/README.md b/devops/flask_app/README.md new file mode 100644 index 000000000..8c162ee24 --- /dev/null +++ b/devops/flask_app/README.md @@ -0,0 +1,8 @@ +To run this application, use Docker source image with python3.9+ +INstall requirements with ```pip install -r requirements.txt``` + +Run application with: +``` +FLASK_APP=main.py +flask run --host=0.0.0.0 --port=8080 +``` diff --git a/devops/flask_app/main.py b/devops/flask_app/main.py new file mode 100644 index 000000000..2a9acf86d --- /dev/null +++ b/devops/flask_app/main.py @@ -0,0 +1,8 @@ +from flask import Flask + +app = Flask(__name__) + + +@app.route('/') +def hello(): + return 'Hello, World!' \ No newline at end of file diff --git a/devops/flask_app/requirements.txt b/devops/flask_app/requirements.txt new file mode 100644 index 000000000..2077213c3 --- /dev/null +++ b/devops/flask_app/requirements.txt @@ -0,0 +1 @@ +Flask \ No newline at end of file