0

HI my question is is it possible and if yes how to have dockerized frontend with TRPC and backend TRPC?

On local development its fine because in monorepo you build backend, frontend and link routers just fine. However if you try to dockerize frontend and backend on their own you of course get errors because TRPC on Frontend doesnt know TRPC on backend.

One solution comes to my mind.. When building frontend image to include backend code, build both and then remove backend from the image. Is this safe, secure and good solution? Or is there any other?

Any suggestions welcome. Thanks!

1 Answers1

1

Answer from one of the TRPC team:

It’s probably best to build the frontend and then copy it into the docker image This isn’t a tRPC issue, it’s a monorepo one, if you depend on other packages in the repo then you obviously can’t copy just the one package in and build it, you have to copy in the whole monorepo Which is fine, just you might increase your image clutter a lot, a 2 stage builder pattern in docker can help there.

Hope this helps to anyone who comes here.