What is the difference between docker-compose ports vs expose

According to the docker-compose reference, Ports is defined as: Expose ports. Either specify both ports (HOST:CONTAINER), or just the container port (a random host port will be chosen). Ports mentioned in docker-compose.yml will be shared among different services started by the docker-compose. Ports will be exposed to the host machine to a random port or … Read more