Chances are if the gasket is doing that and is a number of years old that it's worn out and no longer sealing properly, if so then gluing it in place isn't the solution. You can check the integrity of the seal by closing the door with a dollar bill under the gasket and moving it all the way around the door while it is closed. There should be even resistance on the dollar bill as you pull it around, if it is loose anywhere the gasket is worn out. A new gasket shouldn't be very expensive or hard to install (plenty of online videos) and will save you money in the long run by keeping the cold air inside and allowing the compressor to run less often.