The Error
curl inside container:
curl: (7) Failed to connect to localhost port 5000: Connection refusedQuick Fix - 1 Min
1. Use http://0.0.0.0:5000 not localhost in Dockerfile. 2. ASPNETCORE_URLS=http://+:80 env var. 3. Expose port in docker run: -p 8080:80
Root Cause
Kestrel binds to localhost by default. Docker container localhost!= host localhost.
No comments yet. Be the first to share your thoughts!