Skip to content

new #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

new #28

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -36,5 +33,4 @@ Start web server

Open a browser and go to URL

http://<IP>:5000 => Welcome
http://<IP>:5000/how%20are%20you => I am good, how about you?
http://<IP>:8080
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)