RAM - buy as much as you can. 8GB is NOT enough and will be a bottleneck not matter how fast your processor will be. Keep in mind that most Macs now cannot be upgraded later for more RAM as it was possible in the past.
SSD - If you record audio or use big Sample Libraries, this is where the main throughout bottleneck comes in. Prices come down, but again, keep in mind that you might not be able to upgrade later.
CPU - Now, whatever is left in your budget, get the fastest CPU
As said earlier, having a Mac laptop for music production will be an added advantage of because of suitable pre-installed and app store apps. Lenovo Legion Y520 – Best and Cheap for Music Recording. Listed as a gaming laptop, but it will be suitable for music composing and production too. See it on Amazon. Best sound cards for music production with bundled accessories PreSonus Audiobox 96 Studio. When you buy the PreSonus Audiobox 96 Studio, you get a complete recording bundle.