You can use Schwarz reflection principle to analytically continue $f$ into $D \cup H$, where $H$ is the upper half plane. After that, clearly, $f \equiv 0$, as $f$ has non-discrete set of zeros.
Below I outline the construction of the analytic $g:D \cup H \rightarrow \mathbb C$ such that $g|_D = f$.
It is a variation of the classical Schwarz reflection principle. In the classical case one has a domain $U \subset H$ and a holomorphic $h:U \rightarrow \mathbb C$ such that $h$ can be continuously extended to an open interval $J \subset \overline{U}\cap \mathbb R$ such that $h(J) \subset \mathbb R$. Then it is possible to continue $h$ analytically into $U \cup J \cup U^c$, where $U^c = \{z \in \mathbb C: \overline{z} \in U\}$ - the domain that is symmetric to $U$ with respect to the real line. Moreover, for $z \in U^c$ the analytic continuation is given as $h(z) = \overline{h(\overline{z})}$.
This construction is known to work with more general symmetries than conjugation. In particular, symmetries with respect to circles. Consider following symmetry with respect to the unit circle $T = \partial D$: $z \rightarrow \hat{z} = 1/\overline{z}$. I claim that if a holomorphic function $f:D \rightarrow \mathbb C$ extends to a segment $J$ of $T$ and maps it into the real line, then $f$ can be analytically continued through $J$ outside $D$. The formula for the analytic continuation is $g(z) = \overline{f(\hat{z})}$. Moreover, this works if $f$ maps $J$ into some other circle. In this case conjugation should be replaced with the corresponding symmetry.