Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the Docker run command to mount the current directory into the container for hot reloading.
Docker
docker run -v [1]:/app myapp Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a fixed path instead of the current directory
Forgetting to mount the directory
Mounting the wrong directory
✗ Incorrect
The command uses $(pwd) to mount the current directory into /app inside the container, enabling hot reloading.
2fill in blank
mediumComplete the docker-compose volume syntax to bind mount the local src folder to /app/src in the container.
Docker
volumes:
- [1]:/app/src Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using absolute paths that don't exist locally
Mounting to the wrong container path
Omitting the local folder path
✗ Incorrect
Using ./src binds the local src folder to /app/src inside the container for hot reloading.
3fill in blank
hardFix the error in this Dockerfile command to copy source files for hot reloading.
Docker
COPY [1] /app Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using absolute paths starting with /
Using incorrect folder names
Omitting trailing slash when needed
✗ Incorrect
Using 'src/' correctly copies the source folder contents into /app in the container.
4fill in blank
hardFill both blanks to complete the docker-compose service for hot reloading with bind mounts.
Docker
services:
web:
volumes:
- [1]:[2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping local and container paths
Using absolute local paths
Mounting wrong folders
✗ Incorrect
The local './src' folder is bind mounted to '/usr/src/app' in the container for hot reloading.
5fill in blank
hardFill all three blanks to create a dictionary comprehension that watches files for changes and triggers reload.
Docker
reload_map = { [1]: [2] for [3] in files if changed([3]) } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong variable names
Incorrect comprehension syntax
Missing the condition
✗ Incorrect
The comprehension maps each file to True if it has changed, triggering reload.