A container without a memory limit can take the host down. A container with one gets its process killed by the kernel, which from inside looks like the process simply vanishing with no log line.
docker run --memory=512m --memory-swap=512m shop:latest
# after it dies
docker inspect shop --format '{{.State.OOMKilled}}'
true
Setting --memory-swap equal to --memory disables swap for the container, which is what you want — swapping inside a container is slower than failing and harder to diagnose. PHP-FPM is the usual casualty and it does not log its own death, so OOMKilled on the container is often the only evidence. Set memory_limit in PHP below the container limit so PHP fails first, with a stack trace.