I hope this message finds you well. I am a licensed attorney with over a decade of experience representing law enforcement officers in a variety of ways. It is a pleasure to assist you today.
This answer is actually layered and there are variables. Typically speaking, if your police department receives any federal funding by way of grants and the like, it would be a violation of the Hatch Act (which is federal law) for you to run for public office while you are employed with the department.
Moreover, some municipalities have ordinances that prevent city employees from running for public office. I suggest doing a little research on that front at City Hall to make sure that is not an issue.
Finally, you will need to get permission from your supervisors (preferably the chief) before seeking office. Based on my experience, once you clear the two aforementioned hurdles, you need to inform them as soon as reasonably possible. Don't let them hear it through the grapevine. I have seen what would have otherwise been successful candidates literally sabotaged by their supervisors because they did not report this to them prior to announcing their candidacy. This is somewhat peculiar to law enforcement and I am not really sure why it is the case (probably has to do with rank structure), but you need to run that rabbit trail as well.
So, you may be able to do this, but two main preclusions are the Hatch Act and any local or city ordinance that would preclude you from taking this action. Once those are clear, you need to get permission from your supervisors.
Please rate my answer positively and let me know if you have any other questions or comments.