I think it is in the dog's best interest to have someone else take care of it until you return. Spend time with that person, get the dog acquainted, maybe an overnight or two if you are afraid your dog won't adjust to the new surroundings. But my god, if you are willing to put your dog through the abuse and hell you are describing, you probably don't care.
If your dog hasn't lived on a
boat before, then forcing it to spend 5 months on one is also abuse. Especially a larger bread that usually needs room to run.