Whole bean coffee lasts a lot longer than 10 days. It's fine for like 1 month at least, with some storage methods even 3 (also depends on the roast level). You shouldn't even be brewing it before 10 days after roasting in a lot of cases; you need to let it express gas a bit. Too fresh can be just as bad as too stale! Especially with espresso
I think most great roasters won't sell coffee instantly after roasting it; they'll let it age about a week first. It all depends on the bean though, washing method, drying method, roast level, etc.
Make sure your containers are sealed. You can get ones that have a vacuum pump as well. James Hoffman did a video on various coffee containers, and found a couple to be slightly better than using a jar.
More info
here and
here