We consider a variation of Construction A of lattices from linear codes based on two classes of number fields, totally real and CM Galois number fields. We propose a generic construction with explicit generator and Gram matrices, then focus on modular and unimodular lattices, obtained in the particular cases of totally real, respectively, imaginary, quadratic fields. Our motivation comes from coding theory, thus some relevant properties of modular lattices, such as minimal norm, theta series, kissing number and secrecy gain are analyzed. Interesting lattices are exhibited.