Yes, it will be just fine in a pot. Just maybe not inside when it gets big. While it's still small, indoors is the prefect option, but when it gets bigger a patio, backyard or balcony are all good options.
When the roots of the tree fill the whole pot, let it grow like that for a couple months and then plant it into a bigger pot. Once the roots fill the entire pot, wait a couple months and into a new pot again...and so forth. That's what I do with my citrus trees and they grow just fine! Make sure that the difference in the pots isn't too much. Just a couple inches bigger than the previous pot.
Have fun with your tree and good luck