Skip to content

Conversation

@anandkrsah
Copy link

This Pull Request dockerizes the existing Flask toy app to make it easier to run, consistent across environments, and portable.

Changes included:

  1. Docker setup

    • Added Dockerfile for containerizing the Flask app.
    • Added .dockerignore to avoid copying unnecessary files.
    • Added docker-compose.yml to easily build and run the app with a single command.
  2. Updated requirements

    • Modified requirements.txt to fix dependency conflicts and ensure compatibility with Docker.
  3. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant