diff --git a/Dockerfile b/Dockerfile index aa79e7f..62f3c97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ -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 +LABEL JJTECH +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 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 diff --git a/app.py b/app.py index 36721a0..43168ef 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') 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)