A one-dimensional lattice equation is studied that models the light field in an optical system comprised of a periodic array of optical cavities pumped by a coherent light source. The model includes effects of linear detuning, linear and nonlinear dissipation, and saturable nonlinearity. A wide variety of different parameter regions are studied in which there is bistability between low-power and high-power spatially homogeneous steady states. By posing the steady problem as a time-reversible four-dimensional discrete map, it is shown that temporal stability of these states is a necessary condition for the existence of spatially localized modes. Numerical path-following is used to find both so-called bright solitons (whose core is at a higher intensity than the tails) and grey solitons (with nonzero lower intensity tails), whose temporal stability is also computed. Starting from the case of focusing nonlinearity in the continuum limit and with energy conservation, the effects of dissipation and spatial discreteness are studied both separately and in combination. The presence of Maxwell points, where heteroclinic connections exist between different homogeneous states, is found to lead to snaking bifurcation diagrams where the width of the soliton grows via a process of successive increase and decrease of a parameter representing the pump strength. These structures are found to cause parameter intervals where there are infinitely many distinct stable solitons, both bright and grey. Mechanisms are revealed by which the snakes can be created and destroyed as a second parameter is varied. In particular, the bright solitons reach the boundary of the bistability region where the homogeneous state in the soliton's tail undergoes a fold, whereupon the snake splits into many separate loops. More complex mechanisms underlie the morphogenesis of the grey soliton branches, for example, due to a fold of the homogeneous state that forms the core of the snaking soliton. Further snaking diagrams are found for both defocusing and purely dissipative nonlinearities, and yet further mechanisms are unraveled by which the snakes are created or destroyed as the two parameters vary.