Welcome back! In this task, we’ll set up and test our Flask application on your local machine before pushing it to our GitHub repository. We’ll use VS Code for development, write the application code, declare dependencies, and containerize with Docker.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- VS Code: https://code.visualstudio.com
- Python 3.8+
- Docker installed locally
- Git configured for your project
1. Update the README
OpenREADME.md in VS Code and add a clear project title and description:

2. Project File Structure
| File | Purpose |
|---|---|
| README.md | Overview and setup instructions |
| app.py | Flask application entrypoint |
| requirements.txt | Python dependencies |
| Dockerfile | Docker container build instructions |
3. Create the Flask Application
Createapp.py at the project root with the following code:
/) that returns a greeting.
4. Specify Dependencies
Inrequirements.txt, list your Python packages:
pip which libraries to install inside the container.
5. Write the Dockerfile
CreateDockerfile and add:
- Use a lightweight Python base image
- Copy and install dependencies
- Copy application code
- Expose Flask on all network interfaces
If Flask does not auto-detect or change the
app.py, you can set the environment variable:CMD to:Next Steps
With your files in place (README.md, app.py, requirements.txt, Dockerfile), you’re ready to build and run the Docker image locally: