We consider a complete study of the influence of the cavity size on the spontaneous decay of an atom excited state, roughly approximated by a harmonic oscillator. We confine the oscillator-field system in a spherical cavity of finite radius, perfectly reflective, and work in the formalism of dressed coordinates and states, which allows performing nonperturbative calculations for the probability of the oscillator to decay spontaneously from the first excited state to the ground state. In free space, we obtain known exact results and, for sufficiently small radii, we have developed a power expansion calculation on this parameter. Furthermore, for cavities of arbitrary size radius, we developed numerical computations and showed a complete agreement of this method with the exact one for free space and the power expansion results for small cavities, in this way showing the robustness of our numerical computations. We have found that, in general, the spontaneous decay of an excited state of the oscillator increases with the cavity size radius and vice versa. For sufficiently small cavities, the oscillator practically does not suffers spontaneous decay, whereas for large cavities, the spontaneous decay approaches the free-space value. On the other hand, for some particular values of the cavity radius, in which the cavity is in resonance with the natural frequency of the atom, the spontaneous decay transition probability is increased compared to the free-space case. Also, we showed how the probability of spontaneous decay goes from an oscillatory time behavior, for finite cavity radius, to almost exponential decay, for free space.