Lost docker container after restarting EC2 instance

I was running a python script in EC2 within Docker container. I think the EC2 crashed because of ‘Out of memory’. So I had to restart the EC2 else, couldn’t get into EC2. After restarting I couldn’t find my docker container. Any idea how to restore the docker?
I tried

docker ps -a

It returned nothing. Unable to check logs as well.
Also when I checked inside /var/lib/docker/volumes I only see a .db file.
Any leads on how to recover or How to AVOID this situation in the future?

Source: StackOverflow