Complete the code to expose port 80 on the container to port 8080 on the host.
ports: - "[1]:80"
The format for port mapping is host_port:container_port. Here, port 80 inside the container is mapped to port 8080 on the host.
Complete the code to map port 5432 inside the container to port 15432 on the host.
ports: - "[1]:5432"
Port 5432 is the container port (commonly for PostgreSQL). We map it to 15432 on the host to avoid conflicts.
Fix the error in the port mapping to correctly expose port 5000 on the container to port 5000 on the host.
ports: - "[1]5000"
The correct syntax for port mapping is host_port:container_port. The dash is incorrect here.
Fill both blanks to map port 8080 on the host to port 80 on the container and port 8443 on the host to port 443 on the container.
ports: - "[1]:80" - "[2]:443"
The first line maps host port 8080 to container port 80. The second line maps host port 8443 to container port 443.
Fill all three blanks to create a port mapping in Compose that exposes port 3000 on the host to port 3000 on the container, and port 5000 on the host to port 5000 on the container, and port 8000 on the host to port 80 on the container.
ports: - "[1]:3000" - "[2]:5000" - "[3]:80"
The first two lines map the same host and container ports (3000 and 5000). The last line maps host port 8000 to container port 80.