A fundamental and open question is whether cross-Kerr nonlinearities can be used to construct a controlled-phase (cphase) gate. Here we propose a gate constructed from a discrete set of atom-mediated cross-Kerr interaction sites with counterpropagating photons. We show that the average gate fidelity F between a cphase and our proposed gate increases as the number of interaction sites increases and the spectral width of the photon decreases; e.g., with 12 sites we find F>99%.