We apply the dipole formalism that has been developed to describe low-x deep inelastic scattering to the case of ultra-high energy real photons with nucleon and nuclear targets. We hope that there will be future modeling applications in high-energy particle astrophysics. We modify the dipole model of McDermott, Frankfurt, Guzey, and Strikman (MFGS) by fixing the cross section at the maximum value allowed by the unitarity constraint whenever the dipole model would otherwise predict a unitarity violation. We observe that, under reasonable assumptions, a significant fraction of the real photon cross section results from dipole interactions where the QCD coupling constant is small, and that the MFGS model is consistent with the Froissart bound. The resulting model predicts a rise of the cross section of about a factor of 12 when the the photon energy is increased from $10^{3}$ GeV to $10^{12}$ GeV. We extend the analysis to the case of scattering off a $^{12}$C target. We find that, due to the low thickness of the light nuclei, unitarity for the scattering off individual nucleons plays a larger role than for the scattering off the nucleus as a whole. At the same time the proximity to the black disk limit results in a substantial increase of the amount of nuclear shadowing. This, in turn, slows down the rate of increase of the total cross section with energy as compared to the proton case. As a result we find that the $^{12}$C nuclear cross section rises by about a factor of 7 when the photon energy is increased from $10^{3}$ GeV to $10^{12}$ GeV. We also find that the fraction of the cross section due to production of charm reaches 30% for the highest considered energies with a $^{12}$C target.