Z
Zerops•4d ago
Louay

Monorepo front and back (api using the private ip)

Hello @admin i want to ask first of deploying from a monorepo with a sepecific folder like from app/web and one with apps/api they are both hosted in same repo but in zerops each one in its own service sa i want to scale each indepndently later and i also to askl after deploying both web and server is it possibleto not expose the server with httpsupport and use private ip to call it from front
6 Replies
Pegak
Pegak•4d ago
First one yes, we use it that way, with Nx Monorepo. 🙂
Louay
LouayOP•4d ago
im using turborepo
Pegak
Pegak•4d ago
Should be pretty similar although I am bigger fan of Nx. 🙂
Louay
LouayOP•4d ago
can you show me how for turborepo?
Aleš
Aleš•4d ago
monorepo plays no role in this at all, just create two services and connect them with the same GitHub repo zerops.yml (which you'd put in the root) allows you to define multiple "setups", each for one of the apps
nermal
nermal•4d ago
Two setups in a zerosp.yml for two separate services
zerops:
- setup: app
build:
base: nodejs@20
buildCommands:
- pnpm i
- pnpm run build
deployFiles: /
run:
base: nodejs@20
ports:
- port: 3000
httpSupport: true
start: pnpm run start:api

- setup: api
build:
base: nodejs@20
buildCommands:
- pnpm i
- pnpm run build
deployFiles: /
run:
base: nodejs@20
ports:
- port: 3001
httpSupport: true
start: pnpm run start:api
zerops:
- setup: app
build:
base: nodejs@20
buildCommands:
- pnpm i
- pnpm run build
deployFiles: /
run:
base: nodejs@20
ports:
- port: 3000
httpSupport: true
start: pnpm run start:api

- setup: api
build:
base: nodejs@20
buildCommands:
- pnpm i
- pnpm run build
deployFiles: /
run:
base: nodejs@20
ports:
- port: 3001
httpSupport: true
start: pnpm run start:api
or one setup for one service
zerops:
- setup: turborepo
build:
base: nodejs@20
buildCommands:
- pnpm i
- pnpm run build
deployFiles: /
run:
base: nodejs@20
ports:
- port: 3000
httpSupport: true
- port: 3001
httpSupport: true
startCommands:
- command: pnpm run start:web
name: web
- command: pnpm run start:docs
name: docs
zerops:
- setup: turborepo
build:
base: nodejs@20
buildCommands:
- pnpm i
- pnpm run build
deployFiles: /
run:
base: nodejs@20
ports:
- port: 3000
httpSupport: true
- port: 3001
httpSupport: true
startCommands:
- command: pnpm run start:web
name: web
- command: pnpm run start:docs
name: docs

Did you find this page helpful?