How to set up http3 on a localhost

You need to bind UDP as well. By default, only TCP is bound with docker-compose.

See the docs:

Make sure to follow these instructions so that you get proper HTTP/3 performance. You need to do those things on the host machine.