Let $mathbb{F}_q$ be a finite field of order $q$, a prime power integer such that $q=et+1$ where $tgeq 1,egeq 2$ are integers. In this paper, we study cyclic codes of length $n$ over a non-chain ring $R_{e,q}=mathbb{F}_q[u]/langle u^e-1rangle$. We define a Gray map $varphi$ and obtain many { maximum-distance-separable} (MDS) and optimal $mathbb{F}_q$-linear codes from the Gray images of cyclic codes. Under certain conditions we determine { linear complementary dual} (LCD) codes of length $n$ when $gcd(n,q) eq 1$ and $gcd(n,q)= 1$, respectively. It is proved that { a} cyclic code $mathcal{C}$ of length $n$ is an LCD code if and only if its Gray image $varphi(mathcal{C})$ is an LCD code of length $4n$ over $mathbb{F}_q$. Among others, we present the conditions for existence of free and non-free LCD codes. Moreover, we obtain many optimal LCD codes as the Gray images of non-free LCD codes over $R_{e,q}$.