├── Dockerfile ├── README.md ├── app.py └── requirements.txt /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.6 2 | MAINTAINER Ashok Bollepalli "ashokitschool@gmail.com" 3 | COPY . /app 4 | WORKDIR /app 5 | EXPOSE 5000 6 | RUN pip install -r requirements.txt 7 | ENTRYPOINT ["python", "app.py"] 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Simple Python Flask Dockerized Application# 2 | 3 | Build the image using the following command 4 | 5 | ```bash 6 | $ docker build -t simple-flask-app:latest . 7 | ``` 8 | 9 | Run the Docker container using the command shown below. 10 | 11 | ```bash 12 | $ docker run -d -p 5000:5000 simple-flask-app 13 | ``` 14 | 15 | The application will be accessible at http:127.0.0.1:5000 16 | -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | import os 3 | 4 | app = Flask(__name__) 5 | 6 | @app.route("/") 7 | def hello(): 8 | return "Welcome to Python Flask Application - Ashok IT" 9 | 10 | 11 | if __name__ == "__main__": 12 | port = int(os.environ.get("PORT", 5000)) 13 | app.run(debug=True,host='0.0.0.0',port=port) 14 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | flask 2 | --------------------------------------------------------------------------------