Deploying from a monorepo

If your repository contains multiple services or a mix of backend and frontend code, set a base directory when you create the Forte Service or Website. Forte analyzes that directory, detects or generates its build configuration, and uses it as the container build context.

Set a base directory

  1. Navigate to your project's Services page and click Create service.
  2. Fill in your repository, branch, and service name.
  3. Open the Advanced configuration section.
  4. In the Base directory field, enter the path to your service's subdirectory — for example, packages/api or services/worker.
  5. Complete the rest of the form and click Create service.

Setting a base directory is available through the Forte console only.

What changes when you set a base directory

  • Forte analyzes the files inside your base directory to detect or generate your build configuration.
  • Forte builds your container image using the base directory as the build context, so relative paths in your Dockerfile (for example, COPY . /app) resolve correctly within that directory.
  • You can deploy more than one service from the same repository by pointing each at a different base directory.

If you provide your own Dockerfile, place it inside the base directory and write COPY paths relative to that directory — this is the same behavior you'd get running docker build locally from inside that folder.

Tips and limitations

  • Use a path like packages/api or services/worker. Do not include a leading / or .. segments.
  • If your Dockerfile lives at the root of the base directory (for example, packages/api/Dockerfile), Forte detects it automatically.

Next steps

Search

Search documentation and console pages