The commands that cover the overwhelming majority of "why isn't this container behaving" investigations:
docker ps # what's running right now
docker logs -f web # follow a container's stdout/stderr
docker exec -it web sh # get an interactive shell inside a running container
docker inspect web # full JSON: mounts, env vars, network settings, restart count
docker stats # live CPU/memory/network usage per container
docker top web # processes running inside the container, from the host's view
docker exec only works on a container that's already running and has a shell available (not distroless — see the base image section). For a container that keeps crashing before you can exec into it, docker logs on the exited container (it doesn't need to be running for you to read its logs) and docker inspect's .State section (exit code, OOM-killed flag) are usually the first two places to look — an exit code of 137 specifically indicates the container was killed by SIGKILL, very often because it hit a memory limit (see below) and the kernel's OOM killer stepped in.