I think yes, BUT carefully.
Having it online will definitely discourage publishers, but that doesn't mean all doors suddenly slam shut. They will just be harder to walk through. First I'll tell you what I'm doing related to the question (not necessarily the best), and then a few pointers on what you should do.
I first started writing and posting my story on the mostly-dead writing site of fictionpress.com. As there are only a few people active, you very rarely (you can say almost never) have to worry about people stealing works, and since the story will always have a post date, you can easily prove which came first if it comes down to it. You will also, at some point (it may take a while) attract several readers who will follow. I have 7 (which, for the site, is pretty good when most have 2-3 or none).
These half dozen or so eventually formed the first of my Beta readers, along with my English teachers, a few others I'd Beta-ed before, and a few good not directly related family members (cousins work great here).
I think in your case, maybe skip the posting online part and just find some good friends to Beta the story. If you're on a few random Discord servers, plug there and see how many offers you get.
If you want to post online, only do the first draft as public, and keep the second and onward limited to Betas and editors and such (I find that Google Docs can do this easily). If a publisher ever asks you to take down the first draft in order to publish, do it. You will most likely get more publicity from the publisher.