Answer: The dimensions would be alright although 18 inches would probably be deep enough for most vegetables. A four foot width is more suited to typical lumber dimensions and would dry out more slowly -- assuming you are able to reach across it from both sides.
I am very concerned however about the weight of such a large garden with such a huge cubic capacity. I would strongly recommend you consult with your building engineer and check city codes before you build such a huge raised bed. Your roof may not be able to support that much weight -- soil plus the water to dampen it is incredibly heavy. I am thinking you may find it is more practical to use several large containers and garden intensively in each.
The other typical concern with roof gardens and containers on roofs is that they tend to be very windy. This is stressful and drying on the plants. You may need to water daily in mid summer when the weather is hot, so be sure you have easy access to water. If possible you may want to erect a windbreak for your vegetables as well.
Most rooftop gardens are more concerned with creating a water permeable planting bed growing ground hugging, low maintenance plants to serve as an insulating layer for the building below and to reduce urban runoff. These are developed with great care taken in installing a water barrier and then several layers of soil and drainage material and drainage system and would cover the entire roof or a very large portion of it. Due to construction and design concerns, these are generally planned for during the building planning and design process and engineered to suit the specific building.
In your case I think you are looking more at ways to grow vegetables in containers, since even a raised bed set on an impervious surface could be considered a large container. Best of luck with your project!
Q&A Library Searching Tips