How to deploy monorepo?
Hi all,
I have a application in a monorepo (turborepo with bun), frontend (nextjs + bun) and backend (hono + bun) and some packages. What is the best way of deploying this to dokploy?
They are all in the same repo and need the entire repo to build a single part, I would love to expose the api and the frontend sepperatly.
Is there anyone that can help me with this?
Thanks
5 Replies
If you want to have stability in your vps, my best advice is to build the images in a ci/cd then in dokploy use the docker provider, or if you want to build the images in the vps you can use nixpacks read more here
Node | Nixpacks
App source + Nix packages + Docker = Image
despite I still do not have time to do it by myself, but this is the plan I would go in the future:
- do the check and build by turbo in ci/cd
turbo build
- copy the artifacts of each app and build the docker image separatedly => push to docker hub
- now we can decide to spawn up to anythign we want on dokploy: stage/preview first or just for e2e tests
- after that we could extends into similar process for deploy production, but now it's easier if the tests are all green, we just re-use the docker image with production env vars
this way will keep the dokploy server resources at minimum, because the build , especially from next.js for example, eat a lot of ram
roughly just higher level plan, I will update when I get my hands dirty laterThank you for these tips, i think this is indeed the solution, is it also a good idea to use the self hosted registry in dokploy?
in my opinion the self hosted registry is just business requirements, if your business needs it, go for it, in my business, they do not need it, for now, so I avoid do the self hosted, because I'm lazy 😄