We present a new time-series VI CCD photometry of the globular cluster NGC 6397, from which we obtained and analysed the light curves of 35 variables carefully identified in the cluster field. We assessed the membership of the variables with an astrometric analysis based on Gaia DR2 data. The cluster colour-magnitude diagram was differentially dereddened and cleaned of non members, which allowed us to fit isochrones for [Fe/H] = - 2.0 dex in the range 13.0-13.5 Gyr, for a mean reddening E(B - V) = 0.19 , and a distance of 2.5 kpc. This distance was confirmed using the period-luminosity relation for the cluster's five SX Phoenicis variables (V10, V11, V15, V21, and V23) present among its blue stragglers, yielding 2.24 ± 0.13 kpc. We also modelled the light curves of four eclipsing binaries (V4, V5, V7, and V8), and gave the parameters of the systems; the contact binaries V7 and V8 have distances consistent with that of the cluster. NGC 6397 appears to harbour no RR Lyrae stars, being its horizontal branch remarkably blue, much like that of its analogous cluster, M10. To match the blue tail of the horizontal branch population, models of 0.64-0.66 M⊙ with mass loss at the RGB are required, indicating rather thin shell masses for horizontal branch stars.