The containers might be a little small, I use 6 qt shoebox tubs which work great. Just make sure to have a moisture source for the old food that will grow out into new larva. If there is no water source they will cannibalize each other for water.

I believe adult beetles only live about 4 weeks depending on temps so leaving them a few months may be a bit long =)