I'm very confused about the use of EXPOSE in docker-compose file.
There are tons of examples online using EXPOSE in docker-compose, but the official documentations seems suggest otherwise. Is EXPOSE required for inter-container communication?
https://docs.docker.com/compose/compose-file/
Same for EXPOSE used in Dockerfile, the official docker documentation suggests EXPOSE is used as a way to document ports exposed in the container and is not required. However I still see many current Docker images build with Dockerfile containing EXPOSE (also used in examples on Docker.com)
https://docs.docker.com/engine/reference/builder/#expose
So is EXPOSE really necessary? Can I just omit EXPOSE all together?