I agree with @Pretender
I make a lot of boxes, some from solid wood and many from Baltic Birch plywood. The solid wood boxes do best when running the grain horizontally around all 4 sides of the box. I usually go further and make all four sides sequentially from the same board, so the grain lines match at three of the corners, and the one that doesn't is one of the back corners. With the grain running this way, the box will get slightly taller/shorter with changes in humidity, but will move the same and the corner joints will not crack or split. If making the tops and bottoms out of solid wood you cannot just glue them on, because they will change significantly in width. The grain of the box ends will not be in the same direction as the top and bottom of the box. This is called a "cross grain joint" and you will have problems if you attempt to just glue it. You will need to allow for expansion/contraction. The usual way is to rabbet a groove around the inside of the box near the top and bottom edges of the box sides. Then you make a loose panel from the solid wood to fit this rabbet. It will need a gap at the front and back so it can expand further into this rabbet when the humidity is high and retract further out of it as the wood dries out. Of course, this dimension needs some close calculation to determine how much gap you should have, so the box panel doesn't run out of space when the humidity is high or show a gap when the humidity is very low. This will be determined by the kind of wood as well as the expected variation in moisture content that can be expected. This is the calculator that I use.
Of course, to keep the panels from rattling when the humidity is low, I glue about 1" of the center of each end of the panel into the rabbet. This isn't enough to cause problems, but does keep the panel centered during the very dry times. I also finish the panels before assembling the box, so that I never see an unfinished edge when the panel width shrinks during the low humidity times. I never glue any part of the long grain edges of these panels, since they will need to move in and out.
If you really want the ends of your box to have vertical grain and the sides to have horizontal grain, you will need to assemble your box with a method other than glue. Nails or screws will let the wood joint move enough to allow for humidity changes, but I don't usually like the look of them. Wood screws in counterbores with plugs glued in to cover the screws would be my best suggestion. Flat plugs glued into the counterbore to cover the screw with their grain turned to match the wood becomes almost invisible when finished. They also make round button plugs that look pretty nice. If you want the flat plugs, you should get these and use them in your drill press to cut them from a scrap of the same wood, then cut or break them free as you need them. I frequently put blue tape over them and then just rip the wood on my table saw to cut them free. With the tape, they remain together until I need one. Using dowel rod will show the end grain and will not be nearly as invisible as these tapered plugs, when finished.
These are available in sets or just one from many woodworking supply sources. The link is to show you what they look like. Straight plugs frequently don't fit tight. The tapered plugs fit very tight and stay in well with glue. You then just trim or sand off their tops to make them flush.