Bitcoin
Connection reset making REST API call bitcoind in container

i have Bitcoin When I install it in a container and call the REST API from inside the container it works fine, but when I call it from the host I get the following message:
isudoajl@f38-server:$curl localhost:8333/rest/chaininfo.json
curl: (56) Recv failure: Connection reset by peer
bitcoin.conf
server=1
rpcuser=xxxx
rpcpassword=xxxx
rpcallowip=192.168.1.0/24
rpcport=8332
rest=1
txindex=1
My container is already listening on port 8333.
There are several solutions to this problem. I fought for days but I couldn’t do it.
thank you.