A prominent idea emerging from the study of sleep is that this key behavioural state is regulated in a complex fashion by ecologically and physiologically relevant environmental factors. This concept implies that sleep, as a behaviour, is plastic and can be regulated by external agents and changes in internal state. Drosophila melanogaster constitutes a resourceful model system to study behaviour. In the year 2000, the utility of the fly to study sleep was realised, and has since extensively contributed to this exciting field. At the centre of this review, we will discuss studies showing that temperature, food availability/quality, and interactions with conspecifics can regulate sleep. Indeed the relationship can be reciprocal and sleep perturbation can also affect feeding and social interaction. In particular, different environmental temperatures as well as gradual changes in temperature regulate when, and how much flies sleep. Moreover, the satiation/starvation status of an individual dictates the balance between sleep and foraging. Nutritional composition of diet also has a direct impact on sleep amount and its fragmentation. Likewise, aggression between males, courtship, sexual arousal, mating, and interactions within large groups of animals has an acute and long-lasting effect on sleep amount and quality. Importantly, the genes and neuronal circuits that relay information about the external environment and internal state to sleep centres are starting to be elucidated in the fly and are the focus of this review. In conclusion, sleep, as with most behaviours, needs the full commitment of the individual, preventing participation in other vital activities. A vast array of behaviours that are modulated by external and internal factors compete with the need to sleep and thus have a significant role in regulating it.