How can military discipline be balanced with the religious freedoms of armed forces personnel in a secular democracy like India?

The Supreme Court is considering whether military discipline should take precedence over religious freedom. I want to explore the possible ways to maintain both discipline and individual rights in the armed forces.