From 4ca4d06075322c8a03944908b6cae92e325b0d24 Mon Sep 17 00:00:00 2001 From: anselmenumbisia <70728885+anselmenumbisia@users.noreply.github.com> Date: Fri, 28 Apr 2023 20:56:08 -0600 Subject: [PATCH 1/5] initlal commit --- app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 36721a0..4a5616c 100644 --- a/app.py +++ b/app.py @@ -4,11 +4,11 @@ @app.route("/") def main(): - return "Welcome!" + return "Welcome to Docker Class at JJTECH!" -@app.route('/how are you') +@app.route('/how are you? Hope you are enjoying the class') def hello(): - return 'I am good, how about you?' + return 'Yes Prof, I sure do. I love DevOps?' if __name__ == "__main__": app.run(host="0.0.0.0", port=8080) From 225bea46d0866b333853f4a1d57668fa621fe90c Mon Sep 17 00:00:00 2001 From: anselmenumbisia <70728885+anselmenumbisia@users.noreply.github.com> Date: Fri, 28 Apr 2023 21:50:16 -0600 Subject: [PATCH 2/5] Update Dockerfile --- Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index aa79e7f..3510762 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ -FROM ubuntu:16.04 -RUN apt-get update && apt-get install -y python python-pip -RUN pip install flask -COPY app.py /opt/ +FROM ubuntu +RUN apt update +RUN apt full-upgrade -y && apt install python-pip -y +RUN pip2 install flask +WORKDIR /opt +COPY app.py /opt/app.py ENTRYPOINT FLASK_APP=/opt/app.py flask run --host=0.0.0.0 --port=8080 From 1ea89853e97da941208a1a480633f1b9b3bee52f Mon Sep 17 00:00:00 2001 From: anselmenumbisia <70728885+anselmenumbisia@users.noreply.github.com> Date: Fri, 28 Apr 2023 22:13:37 -0600 Subject: [PATCH 3/5] Update Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 3510762..62f3c97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM ubuntu +LABEL JJTECH RUN apt update RUN apt full-upgrade -y && apt install python-pip -y RUN pip2 install flask From 2d9d6a92606f52f6886c674a2db8480214b8e10d Mon Sep 17 00:00:00 2001 From: anselmenumbisia <70728885+anselmenumbisia@users.noreply.github.com> Date: Fri, 28 Apr 2023 22:14:20 -0600 Subject: [PATCH 4/5] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 4a5616c..43168ef 100644 --- a/app.py +++ b/app.py @@ -6,7 +6,7 @@ def main(): return "Welcome to Docker Class at JJTECH!" -@app.route('/how are you? Hope you are enjoying the class') +@app.route('/how are you') def hello(): return 'Yes Prof, I sure do. I love DevOps?' From 80867beb928a67d56f66ca6bc74a14fa605a095f Mon Sep 17 00:00:00 2001 From: anselmenumbisia <70728885+anselmenumbisia@users.noreply.github.com> Date: Fri, 28 Apr 2023 22:18:37 -0600 Subject: [PATCH 5/5] Update README.md --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6027980..785fa8d 100644 --- a/README.md +++ b/README.md @@ -9,22 +9,19 @@ This is used in the demonstration of development of Ansible Playbooks. - Install and Configure Web Server - Start Web Server -## 1. Install all required dependencies +## 1. Install python Python and its dependencies - apt-get install -y python python-setuptools python-dev build-essential python-pip python-mysqldb - + apt update && apt full-upgrade -y && apt install python-pip -y ## 2. Install and Configure Web Server Install Python Flask dependency - pip install flask - pip install flask-mysql + pip2 install flask -- Copy app.py or download it from source repository -- Configure database credentials and parameters +- Copy app.py or download it from source repository ## 3. Start Web Server @@ -36,5 +33,4 @@ Start web server Open a browser and go to URL - http://:5000 => Welcome - http://:5000/how%20are%20you => I am good, how about you? + http://:8080