caprover-cli icon indicating copy to clipboard operation
caprover-cli copied to clipboard

Deploy command with subdirectory

Open tiloio opened this issue 6 years ago • 2 comments

Why do I can't choose a subdirectory for me application root? It is only possible to have another branch.

But if you have a frontend and a backend you want both in one repository and not in two branches.

tiloio avatar Jun 07 '19 15:06 tiloio

You can use custom captain-definition paths.

  • Create a frontend and a backend app on CapRover
  • Go to the web dashboard and under the deployment tab (at the bottom) change captain-definition path to frontend-captain-definition for frontend app, and backend-captain-definition for backend app.
  • Create these two captain-definition file with custom dockerfile and have their path corrected.

Now you can deploy your source to each app and the correct.


Another approach is to have one captain-definition file in each directory (frontend and backend). Make no custom change to captain-definition and use the custom tarfile option and create the tar file of your subdirectory yourself, example: https://caprover.com/docs/recipe-deploy-create-react-app.html

githubsaturn avatar Jun 08 '19 16:06 githubsaturn

I think both approaches are not very convenient.

If I want to deploy more than two apps in a repo fast, I have to use the tar file option, which is manually very slow and annoying. A proper CLI would be great for that. Otherwise I would always write a shell script which does that for me...

tiloio avatar Jun 11 '19 15:06 tiloio