Intracellular polarization, where a cell specifies a spatial axis by segregation of specific factors, is a fundamental biological process. In the early embryo of the nematode worm Caenorhabditis elegans (C. elegans), polarization is often accompanied by deformations of the cortex, a highly contractile structure consisting of actin filaments cross-linked by the motor protein myosin (actomyosin). It has been suggested that the eggshell surrounding the early embryo plays a role in polarization although its function is not understood. Here we develop a mathematical model which couples a reaction-diffusion model of actomyosin dynamics with a phase field model of the cell cortex to implicitly track cell shape changes in the early C. elegans embryo. We investigate the potential rigidity effect of the geometric constraint imposed by the presence and size of the eggshell on polarization dynamics. Our model suggests that the geometric constraint of the eggshell is essential for proper polarization and the size of the eggshell also affects the dynamics of polarization. Therefore, we conclude that geometric constraint on a cell might affect the dynamics of a biochemical process.