Dockworkers on the U.S. East and Gulf coasts overwhelmingly approved a six-year contract Tuesday, averting the threat of a strike that could have crippled the economy.