Given that a user has created this file so far:
version: '3.8'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch
ports:
pressing enter should automatically open intellisense and suggest to add both the lines:
Because they are popular port mappings for elasticsearch