Complete the code to specify the Compose file version at the top.
version: '[1]' services: web: image: nginx
The Compose file version is specified as a string at the top. Version '3.8' is a common modern version.
Complete the Compose file to define a service named 'db'.
version: '3.8' services: [1]: image: postgres
The service name here should be 'db' to represent the database service.
Fix the error in the Compose file version declaration.
version: [1]
services:
app:
image: alpineThe version must be a string in quotes, like '3.7'. Without quotes, it causes a syntax error.
Fill both blanks to define a Compose file with version and a service named 'cache'.
version: '[1]' services: [2]: image: redis
The Compose file version is '3.9' and the service name is 'cache' for Redis.
Fill all three blanks to create a Compose file with version, a service named 'web', and specify the image.
version: '[1]' services: [2]: image: [3]
The Compose file version is '3.8', the service is 'web', and the image is 'nginx:latest'.