We present a model of (modified) gravity on spacetimes with fractal structure based on packing of spheres, which are (Euclidean) variants of the Packed Swiss Cheese Cosmology models. As the action functional for gravity we consider the spectral action of noncommutative geometry, and we compute its expansion on a space obtained as an Apollonian packing of 3-dimensional spheres inside a 4-dimensional ball. Using information from the zeta function of the Dirac operator of the spectral triple, we compute the leading terms in the asymptotic expansion of the spectral action. They consist of a zeta regularization of a divergent sum which involves the leading terms of the spectral actions of the individual spheres in the packing. This accounts for the contribution of the points 1 and 3 in the dimension spectrum (as in the case of a 3-sphere). There is an additional term coming from the residue at the additional point in the real dimension spectrum that corresponds to the packing constant, as well as a series of fluctuations coming from log-periodic oscillations, created by the points of the dimension spectrum that are off the real line. These terms detect the fractality of the residue set of the sphere packing. We show that the presence of fractality influences the shape of the slow-roll potential for inflation, obtained from the spectral action. We also discuss the effect of truncating the fractal structure at a certain scale related to the energy scale in the spectral action.