SocketIO channel gets disconnected with docker compose file

I have set to transports to websocket in code then it worked.

this.socket = io.connect('http://localhost:5005/', { transports: ['websocket'] });