Complete the code to specify the Docker image for the service.
services:
app:
image: [1]The image key specifies the Docker image to use for the service.
Complete the code to expose port 8080 from the container to the host.
services:
app:
ports:
- "[1]:8080"The format hostPort:containerPort maps the container's port 8080 to the host's port 8080.
Fix the error in the volume mapping to persist data.
services:
db:
volumes:
- [1]:/var/lib/postgresql/dataUsing ./data maps a local folder to the container's data folder, persisting data.
Fill both blanks to define environment variables for the database service.
services:
db:
environment:
- [1]=postgres
- [2]=password123These are the standard environment variables for PostgreSQL Docker images.
Fill all three blanks to define a build context, Dockerfile, and container name for the app service.
services:
app:
build:
context: [1]
dockerfile: [2]
container_name: [3]The context is the folder with the Dockerfile, dockerfile is the filename, and container_name names the container.