0
0
Dockerdevops~10 mins

Compose watch for development in Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to start services in detached mode using Docker Compose.

Docker
docker-compose up -[1]
Drag options to blanks, or click blank then click option'
Ar
Bf
Cd
Ds
Attempts:
3 left
💡 Hint
Common Mistakes
Using -f which is for specifying a file
Using -r which is not a valid flag here
2fill in blank
medium

Complete the command to rebuild services before starting them.

Docker
docker-compose up --[1]
Drag options to blanks, or click blank then click option'
Aforce-recreate
Bbuild
Crebuild
Drestart
Attempts:
3 left
💡 Hint
Common Mistakes
Using --force-recreate which recreates containers but does not build images
Using --rebuild which is not a valid option
3fill in blank
hard

Fix the error in the command to watch file changes and restart services automatically.

Docker
docker-compose up -[1] --watch
Drag options to blanks, or click blank then click option'
Adetach
Bdetached
Cdetach-mode
Dd
Attempts:
3 left
💡 Hint
Common Mistakes
Using --watch which is not supported
Using incorrect long flags like --detached
4fill in blank
hard

Fill both blanks to create a service that watches for file changes and restarts automatically using a tool.

Docker
version: '3.8'\nservices:\n  app:\n    build: .\n    command: [1] --watch [2] app.js\n    volumes:\n      - .:/app\n    ports:\n      - '3000:3000'\n
Drag options to blanks, or click blank then click option'
Anodemon
Bnode
C--exec
D.
Attempts:
3 left
💡 Hint
Common Mistakes
Using node instead of nodemon
Using --exec which runs a command but does not watch files
5fill in blank
hard

Fill all three blanks to define a Docker Compose service that uses a volume, sets environment variables, and runs a watch command.

Docker
version: '3.8'\nservices:\n  web:\n    build: .\n    volumes:\n      - [1]:/usr/src/app\n    environment:\n      - NODE_ENV=[2]\n    command: [3] --watch src\n    ports:\n      - '8080:8080'\n
Drag options to blanks, or click blank then click option'
A./app
Bdevelopment
Cnodemon
D./src
Attempts:
3 left
💡 Hint
Common Mistakes
Using ./src as volume instead of ./app
Setting NODE_ENV to production
Using node instead of nodemon