Docker Compose - docker-compose.yml リファレンス - Qiita
https://qiita.com/zembutsu/items/9e9d80e05e36e882caaa#expose
> ホストマシン上にポートを露出(expose)しますが、公開はしません。リンクされたサービスのみアクセスできます。内部ポートのみ指定できます。
Compose file version 3 reference | Docker Documentation
https://docs.docker.com/compose/compose-file/#expose
> Expose ports without publishing them to the host machine - they’ll only be accessible to linked services. Only the internal port can be specified.