The mayor and council shall have full power and authority to pass, enact, and adopt any and all ordinances they deem necessary to protect the peace, comfort, health, prosperity, and security of the city and its inhabitants, to foster good morals and virtues in said city, and to suppress any and all acts against the peace and good order.