I like FOSS and even just OSS and I have good arguments, largely borrowed from others, for why it's good and why we should often use it. It's not a panacea, though. I'm about to write some things that RMS would not endorse.
If the code is your original, differentiating product, go ahead and make it proprietary if it helps you. If there's some code that supports your product, that helps make your product possible, or that complements your product but doesn't really differentiate your work or create a bespoke advantage for your users, then seriously consider making that Open Source or Free Software.
For example, let's say you have a new, great music recommendation technique and that's why people would choose your music player or music web site or whatever. You could build that with an OS DB on the backend, on an OS operating system, using an Open Source language and Open Source libraries and still close the source for your recommendation engine. However, you could still offer a F/OSS client to an API for that for various languages. You could contribute to the projects underlying yours. You might write a whole new configurable data wrangling system that's not specific to your recommendation code but is really useful to populating your database, and you could release that as F/OSS for the community to use. You might make your own front-end toolkit for the browser, or your own websockets code on the backend, that can be used by any application. You'd be able to contribute that to the community as F/OSS without undercutting your main differentiator, too. I kind of think of this model akin to open core, but in this case it's a "Closed Core" with open everything else. Improve everything that's in common with others in a common space, and differentiate your offering in your own different, compartmentalized space. Just make sure the bindings between the parts are at the appropriate level so the licenses don't clash.
Does this mean some competitor could come along, tie all of your F/OSS together, and plug in a different core? Absolutely. If that core's not your true differentiator, though, your plans have probably already gone awry. Making it easy to plug other code in the place of your proprietary code surrounded by an open platform is almost as good for the community as making the whole thing open source, and lets you compete on what you've decided is going to be your competitive advantage.