I know that I can specify the protocol of "ports" in the docker-compose.yml
file, but I am unsure what the default protocol is, if no protocol is specified.
Is it TCP? Is it UDP? Both?
I haven't been able to find the answer anywhere (including in the Docker Compose file reference).
by default TCP is used, you can see it launching docker-compose ps
If you want to specify you should add /udp or /tcp like :
ports:
- "80:80/udp"
- "80:80/tcp"
In addition to above comment for me docker compose long syntax worked to open udp port ,do also check that your required port is open and available to cater request. https://docs.docker.com/compose/compose-file/compose-file-v3/#ports
ports:
- target: 18123
published: 18123
protocol: UDP
mode: host
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With