This video from GDQuest might help you.
By the way, you didn't give which Godot version you're using, 3.5 and 4.0 doesn't not manage containers the same way, and AFAIK, we need to give a custom minimum size at one point because containers are unable to calculate one themselves, even and especially when they have some content which have a defined size (label or texture for instance.)