Seenode Documentation
DocsTutorialsSign in
  • Docs
  • Quickstart
    • Deploy a FastAPI app
  • API
    • Getting an API token
  • Deploying
    • Build & Start command
    • Root directory configuration
    • Port configuration
    • Deploying using GitHub actions
    • Deploying using GitLab CI/CD
    • Install Node to Python image
Powered by GitBook
On this page
  • Overview
  • How it works
  • Example repository structure
  • Setting the root directory
  • Example usage
  • Conclusion
  1. Deploying

Root directory configuration

The root directory setting allows you to specify a subdirectory within a repository. This is useful when frontend and backend services, reside in different folders within the same repository.

Overview

The Root Directory setting allows you to specify a subdirectory within a repository for deployment. This is useful for monorepositories where multiple applications, such as frontend and backend services, reside in different folders within the same repository.

By default, the root directory is set to the root of the GitHub/GitLab repository. If your application is inside a subfolder, you must provide a relative path to that folder.

How it works

  • The start command and build command are executed inside the directory specified in the root directory setting.

  • If no root directory is set, commands run at the repository root.

  • This setting enables deploying separate services (e.g., frontend & backend) from the same repository.

Example repository structure

Consider a monorepository with the following structure:

/my-repo
│── frontend
│   ├── package.json
│   ├── src/
│   ├── public/
│── backend
│   ├── requirements.txt
│   ├── app/
│   ├── main.py
│── README.md

Setting the root directory

To deploy the frontend, set the root directory to:

frontend

To deploy the backend, set the root directory to:

backend

Example usage

Deploying a frontend (React)

If the frontend is in frontend/, set:

  • Root directory → frontend

  • Build command → npm install && npm run build

  • Start command → npm start

Deploying a backend (Python Flask)

If the backend is in backend/, set:

  • Root directory → backend

  • Build command → pip install -r requirements.txt

  • Start command → python main.py

Conclusion

Using the Root Directory setting allows flexible deployments from monorepositories, ensuring commands run in the correct directory without affecting other parts of the repository.

PreviousBuild & Start commandNextPort configuration

Last updated 2 months ago