We have had some excellent success with growing herbs on the boat, while traveling. I am not optimistic your plan to grow vegetables will work, unless you are stationary and have lots of deck space to devote to it.
We use a set of "nested" dishpans from Ikea. We drill holes for drainage in the bottom of the pan we plant the herbs in and then set that in the second dishpan, on top of a few large-ish pebbles. This is all to help with drainage. The end result, is no dirty water draining on your deck
This only turned out to be a successful endeavor once we discovered that most herbs don't like gale-force winds and salt air/spray. The remedy is to bring the herbs inside when the weather is like this.
We can get about 6 herb plants in one dishpan. Typically, 2 Italian basil, Cilantro, Parsley, Thai basil and Tarragon.
The bottom of the dishpan has something like "feet" that really help keep it from sliding around on the aft teak deck.