flask-example
flask-example copied to clipboard
Dockerized Flask app: added Docker setup and updated README
This Pull Request dockerizes the existing Flask toy app to make it easier to run, consistent across environments, and portable.
Changes included:
-
Docker setup
- Added
Dockerfilefor containerizing the Flask app. - Added
.dockerignoreto avoid copying unnecessary files. - Added
docker-compose.ymlto easily build and run the app with a single command.
- Added
-
Updated requirements
- Modified
requirements.txtto fix dependency conflicts and ensure compatibility with Docker.
- Modified
-
Updated README
- Added a Docker Prerequisites section (Git, Docker, Docker Compose).
- Added Docker run instructions (build, start, check, stop containers).
- Explained benefits of Dockerization: easy setup, consistency, portability, and isolation.
Benefits:
- Easy setup: Run the app anywhere without installing Python or dependencies manually.
- Consistency: Same behavior in dev, staging, or production environments.
- Portability: Works on any system with Docker installed.
- Isolation: Containers prevent conflicts with host system packages.
How to test:
git clone https://github.com/anandkrsah/flask-example.git
cd flask-example
git checkout dockerize-app
docker-compose up -d
Then open: http://localhost:5000/
All containers will start automatically; no additional images or manual setup required.