An 8.7 magnitude earthquake struck off the coast of Indonesia on Wednesday, sending residents around the region dashing out of their homes and offices in fear.