Background: Interactions between topologically associating domains (TADs), and between the nuclear envelope (NE) and lamina-associated domains (LADs) are expected to shape various aspects of 3D chromatin structure and dynamics at the level of the entire nucleus; however, a full quantitative picture is still lacking. Relevant genome-wide experiments that may provide statistically significant conclusions remain difficult. Results: We have developed a coarse-grained dynamic model of the Drosophila melanogaster nucleus at TAD (about 100 kb) resolution that explicitly accounts for four distinct epigenetic classes of TADs and describes time evolution of the chromatin over the entire interphase. Best agreement with experiment is achieved when the simulation includes an entire biological system - an ensemble of complete nuclei, corresponding to the experimentally observed set of mutual arrangements of chromosomes, properly weighted according to experiment. The model is validated against multiple experiments, including those that describe changes in chromatin induced by lamin depletion. Predicted positioning of LADs at the NE is highly dynamic (mobile) - the same LAD can attach, detach, and re-attach itself to the NE multiple times during interphase. The average probability of a LAD to be found at the NE varies by an order of magnitude, determined by the highly variable local density of nearby LADs along the genome. The distribution of LADs along the genome has a strong effect on the average radial positioning of individual TADs, playing a notable role in maintaining a non-random average global structure of chromatin. Predicted sensitivity of fruit fly chromatin structure to the balance between TAD-TAD and LAD-NE interactions, also observed previously in models of mammalian chromosomes, suggests conservation of this principle of chromatin organisation across species of higher eukaryotes. Reduction of LAD-NE affinity weakly affects local chromatin structure, as seen in the model-derived Hi-C maps, however, its wild-type strength substantially reduces sensitivity of the chromatin density distribution to variations in the strength of TAD-TAD interactions. Conclusions: A dynamical model of the entire 3D fruit fly genome makes multiple genome-wide predictions of biological interest. We conjecture that one important role of LADs and their attractive interactions with the NE is to create the average global chromatin structure and stabilize it against inevitable cell-to-cell variations of TAD-TAD interactions.