0
0
Dockerdevops~20 mins

Compose watch for development in Docker - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Compose Watch Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
What is the output of this Docker Compose watch command?
You run this command to watch file changes and restart the service automatically:
docker compose watch

What will you see in the terminal when a source code file changes?
AThe container restarts but does not rebuild the image, showing only logs.
BThe service ignores file changes and continues running without any output.
CThe service rebuilds and restarts automatically, showing build logs and container logs.
DThe command exits immediately with an error about missing watch flag.
Attempts:
2 left
💡 Hint
`docker compose watch` detects changes in the build context.
Configuration
intermediate
1:30remaining
Which docker-compose.yml snippet enables live code reload with volume mounting?
You want your container to reflect code changes immediately during development. Which volume configuration achieves this?
A
volumes:
  - ./app
B
volumes:
  - ./app:/app
C
volumes:
  - app:/app
D
volumes:
  - /app
Attempts:
2 left
💡 Hint
Mount your local folder into the container path.
🔀 Workflow
advanced
2:00remaining
What is the correct sequence to enable live reload with Docker Compose and nodemon?
You want to develop a Node.js app with live reload inside a container using nodemon. Which sequence of steps is correct?
A1,2,3,4
B2,1,3,4
C1,3,2,4
D3,1,2,4
Attempts:
2 left
💡 Hint
Think about installing tools before configuring and running.
Troubleshoot
advanced
1:30remaining
Why does your container not reflect code changes despite volume mounting?
You mounted your local code folder into the container, but changes are not visible inside the container. What is the most likely cause?
AThe container runs a built image that overwrites the mounted volume at startup
BThe container has no network access
CDocker daemon is not running
DThe volume path on the host is incorrect or empty
Attempts:
2 left
💡 Hint
Verify the host-side path first.
Best Practice
expert
2:30remaining
Which approach best supports fast iterative development with Docker Compose?
You want to develop a Python web app with fast code reload and minimal container rebuilds. Which setup is best?
AUse volume mounts for source code, run the app with a file watcher like 'watchmedo', and rebuild images only when dependencies change
BCopy source code into image during build and restart container on every code change
CRun the app inside the container without volume mounts and rebuild image on every code change
DUse bind mounts only for dependencies folder and copy source code into image
Attempts:
2 left
💡 Hint
Minimize rebuilds and use live reload tools.