My frontend and backend are not in the same project

I am using front and backend code that I already have [in react and go] are there any suggestions where to put the compose file in that case; or is it better to put front and backend in the same project?

It’s not that I have much experience - I just finished the Docker course today… But I’d try to compose from the project I most frequently like to compose from or even a separate project just for composing.

I’d then refer to the services that are not in the current project by their image: instead of build:ing them. Just as we did with the database service. We used a mongodb image from dockerhub there but it could also be an image we have locally or in our own image repository.

That might be total nonsense, please bear with me. But it sounds plausible to me.