City, union reach 3-year contract