The town of Setenil de las Bodegas, in Spain has about 3,000 inhabitants. Their town has the particular feature of being built under a giant rock formation. It's located just northeast of Cadiz.
The rock formation was eroded by the Trejo river, which allowed for easy construction of the houses under the walls of the gorge itself. The natural caves of Setenil are ideal for them because they don't need to build entire houses, just a façade. The rocks also keep them cool in the summer and warm in the winter. Check the source for more photos!