MAX-Text-Sentiment-Classifier icon indicating copy to clipboard operation
MAX-Text-Sentiment-Classifier copied to clipboard

How to change the port 5000 (Deploy with docker)

Open saleheenkhan opened this issue 4 years ago • 4 comments

Hi, It would be appreciated if you can let me know how i can use different port then 5000. I tried to change it but its only work with 5000 Port

Steps I took I ran the docker command with different port I Updated the dockerfile to expose 5001 not workrd

I have build the images locally with specifying another port

None of above working.

Look forward to hear from you.

Thanks, Sk

saleheenkhan avatar Apr 24 '20 23:04 saleheenkhan

Have you tried passing -p 5001:5000 to docker run?

docker run -it -p 5001:5000 codait/max-text-sentiment-classifier

xuhdev avatar Apr 24 '20 23:04 xuhdev

Hi, Thanks for your reply. I tried above but the app still running with port 5000 image

saleheenkhan avatar Apr 25 '20 08:04 saleheenkhan

This is what's happening in the container. The app still opens Port 5000, but Port 5000 in the container has now been mapped to Port 5001 on the host. If you try to connect to localhost:5001 from your host, it should work.

xuhdev avatar Apr 25 '20 20:04 xuhdev

Are you using Autofact? I had the same problem and noticed that it was caused by Autofact component. .UseServiceProviderFactory(new AutofacServiceProviderFactory())

RafaelMeloTrakx avatar Oct 12 '21 15:10 RafaelMeloTrakx