I would recommend using port ranges i.e.
ports:
- "1-65535:1-65535"
You will probably need to tinker with this range according to your application specifications so that you do not accidentally discover what is already being used by the host (e.g. SSH).
amirb source
share