Complete the code to define a service named web in a Docker Compose file.
services:
web:
image: nginx
[1]: "80:80"The ports key maps container ports to host ports, allowing access to the service.
Complete the code to add a profile named 'debug' to the service 'app'.
services:
app:
image: myapp
profiles:
- [1]The profiles key allows selective activation of services. Here, 'debug' is the profile name.
Fix the error in the profile definition for the service 'db'.
services:
db:
image: postgres
profiles: [1]The profiles key expects a list. Using ['debug'] is the correct YAML list syntax.
Fill both blanks to define two services with profiles 'frontend' and 'backend'.
services:
ui:
image: ui-image
profiles:
- [1]
api:
image: api-image
profiles:
- [2]Assigning 'frontend' to the UI service and 'backend' to the API service allows selective startup.
Fill all three blanks to create a service with a profile and port mapping.
services:
cache:
image: redis
profiles:
- [1]
ports:
- "[2]:[3]"The service 'cache' uses the profile 'cache' and maps port 6379 on host to 6379 in container.