It's been pretty well established in canon after TOS that Starfleet is not a military organization.
Even if you want to argue that Starfleet doesn't consider themselves military by the TNG era, Discovery takes place before TOS, Thus Kirk's statement has not been contradicted or retconned. Archer's statements are about Earth's Starfleet. We have no evidence that those "not military" ideas would be transferred to the Early Federation Starfleet. And since the MACO's were explicitly military, and absorbed into the Federation Starfleet we have reason to believe that the Early Federation Starfleet was explicitly a military organization.