The system will try to match your clan into the highest bracket based on available members, and remember that clan war team sizes are always in multiples of 5.
When a member is "ineligible for war", they're not considered at all when it comes to matching up for the clan war.
In your example, you have 2 people ineligible and 40 people that are eligible. The system will take these 40 eligible people and start a 40v40 war with 2 spectators. If you had 3 people ineligible thus making it 39 people that are eligible, then it would start a 35v35 war with 8 spectators.
Mass Dragons + Rage Spells is one of the most effective strategies for getting stars around TH7/8, in my opinion. It's generally pretty easy to deploy as well.
That said, as you've noted it's very resource intensive. The thing is, Clan Wars aren't really great for elixir gains. You're much better off with collector raids with BARCH to get elixir, and even gold for that matter. Clan Wars are really mostly good for getting the Dark Elixir bonuses.
There are a couple of alternative strategies, though, that you might consider.
One is Giant/Healer which is basically just a swarm of Giants, with a few Wall Breakers to speed up the process, and 1 or 2 Healers and Heal spells to back them up. The problem with this is speed - Giants are slow. You might have the base dead to rights and run out of time - especially when factoring in the time it takes to lure the Clan Castle. Also the Healers are air and the Giants won't tank air defenses for them.
Another is Dragons + Balloons. Balloons are somewhat cheaper and they target defenses. The Dragons can drop first and tank for the Balloons, which makes them a bit more likely to hit air defenses before they get taken out. This strategy works best when the AD's are close to the outside of the base, and you can blitz them quickly.
DE troops at TH7 are both weak and costly, so I don't suggest using them.
Another important factor to consider when choosing a war raid troop composition is what troops and spells have you upgraded? Ideally you want to max out your troops before you use them in clan wars. Even with the best strategy and perfect troop mix, if your troops are underleveled the attack will go to waste.
Best Answer
You will have the full 3 minutes to perform your attack if you start your attack with at least 1 second left on the war clock. It will not stop your attack and force a surrender as long as you do so.
However, once the war clock reaches 0, no new attacks can take place and the war will end once the final attacks are completed.
Source: I have done this before a few times, lost to this a few times, forums, and here is a youtube clip of this.
(screenshot is from the youtube clip linked above)