We consider the $hp$-version interior penalty discontinuous
Galerkin finite element method ($hp$-DGFEM) for linear second-order
elliptic reaction-diffusion-advection equations with mixed Dirichlet and
Neumann boundary conditions. Our main concern is the extension of the
error analysis of the $hp$-DGFEM to the case when anisotropic
(shape-irregular) elements and anisotropic polynomial degrees are used.
For this purpose, extensions of well known approximation theory results
are derived. In particular, new error bounds for the approximation error
of the $L^2$-and $H^1$-projection operators are presented, as well as
generalizations of existing inverse inequalities to the anisotropic
setting. Equipped with these theoretical developments, we derive general
error bounds for the $hp$-DGFEM on anisotropic meshes, and anisotropic
polynomial degrees. Moreover, an improved choice for the (user-defined)
discontinuity-penalisation parameter of the method is proposed, which
takes into account the anisotropy of the mesh. These results collapse to
previously known ones when applied to problems on shape-regular
elements. The theoretical findings are justified by numerical
experiments, indicating that the use of anisotropic elements, together
with our newly suggested choice of the discontinuity-penalisation
parameter, improves the stability, the accuracy and the efficiency of
the method.