-
Create a new folder called
coderco-challenge. -
Inside that folder, create these files:
count.py– Flask app that talks to RedisDockerfile– builds the Python imagedocker-compose.yml– defines thewebandredisservicesrequirements.txt– lists Python dependencies
-
Install Docker Desktop and make sure the Docker engine is running.
-
Open the folder in VS Code.
-
Build and start everything with Docker Compose:
docker compose up --build
-
Once both containers are running, open:
http://localhost:5002/→ welcome pagehttp://localhost:5002/count→ visit counter backed by Redis
-
Stop and clean up the containers when you’re done:
docker compose down -v
-
Python indentation errors
If a function in
count.pyisn’t indented correctly, the container will crash on start.- Tip: make sure each function body is indented with 4 spaces under the
defline.
- Tip: make sure each function body is indented with 4 spaces under the
-
App file in the wrong place
Docker needs to find
count.pyinside the same folder as theDockerfileanddocker-compose.yml.-
Tip: confirm the structure looks like:
coderco-challenge/
├─ count.py
├─ Dockerfile
├─ docker-compose.yml
├─ requirements.txt
-
-
Docker engine not running
If
docker compose uphangs or fails immediately, Docker Desktop might not be running.- Tip: open Docker Desktop first and check that it says “Engine running” before using the terminal.