Spin is a fundamental degree of freedom, which was discovered by Dirac for an electron in his relativistic quantum mechanics, known as the Dirac equation. The origin of spin for a photon is unclear because Maxwell's equations in a vacuum are Lorentz invariant without introducing the concept of spin. Here, the propagation of coherent rays of photons in a graded-index optical fibre is considered to discuss the origin of polarisation for photons using exact solutions of the Laguerre-Gauss and Hermite-Gauss modes. The energy spectrum is massive, and the effective mass is a function of the confinement and orbital angular momentum. The propagation is described by the one-dimensional (1 D) non-relativistic Schrödinger equation, which is equivalent to the 2 D space-time Klein-Gordon equation by a unitary transformation. The probabilistic interpretation and the conservation law require the factorisation of the Klein-Gordon equation, leading to the 2 D Dirac equation with spin. The spin expectation values of photons correspond to the polarisation state on the Poincaré sphere. As an application of the theory, a polarisation interferometer is proposed, whose energy spectrum shows a Dirac cone in the Stokes parameter space.