You are already opening the port inside, so the only thing I can offer is to check that you open the port when you start your image:
docker run -it -p 5000:5000 <imagename>
This will open port 5000 inside the instance on port 5000 on your local computer and then be available on 127.0.0.1:5000or localhost:5000.
, Main() Program.cs .UseUrls("http://*:5000/") WebHostBuilder.