Indoor I typically don't go under 3 gallon unless running coco. Coco you can push hard, even in small bags you can get monster plants.Then I'll drop down to 1 gallon.
Am usually in 5 gallon bags with soil.
Outdoor that changes, as 5 gallon bags will get too warm in the summer. No smaller than 10 gallon bags, preferably 20.
Indoor, in soil, less than 3 gallon and I see a drop off in overall size and harvest weight. Over 5 and I don't see any increase in plant size or weight, so seems like between 3-5 is the sweet spot for indoor.
Rule of thumb is 1 gallon of soil needed for each month of plant life expected. Most autos are done in under 90 days, so 3, but I run the 5s for a little cushion.
I have run in 1 gallon bags of soil on a seed run. Plants stayed small, and needed much more bottled nutes over all.