Complete the code to define a service named 'web' using the nginx image.
services:
web:
image: [1]The image field specifies which Docker image the service uses. Here, 'nginx' is the correct image for a web server.
Complete the code to expose port 80 on the 'web' service.
services:
web:
image: nginx
ports:
- "[1]:80"The ports mapping format is host_port:container_port. To expose port 80 on the host to port 80 in the container, use '80:80'.
Fix the error in the service definition by completing the restart policy.
services:
web:
image: nginx
restart: [1]The restart policy 'always' ensures the container restarts automatically if it stops.
Fill both blanks to define environment variables for the 'db' service.
services:
db:
image: mysql
environment:
- [1]=root
- [2]=password123Environment variables for MySQL include MYSQL_USER for the username and MYSQL_PASSWORD for the user's password.
Fill all three blanks to define a volume mount for the 'web' service.
services:
web:
image: nginx
volumes:
- [1]:[2]:[3]The volume mount syntax is host_path:container_path:mode. Here, ./html is the folder on the host, /usr/share/nginx/html is the container folder, and ro means read-only.