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. Open your project's Services or Websites page and click Create service or Create website.
  2. Fill in your repository, branch, and name.
  3. In the Base directory field, enter the path to the app's folder: for example, packages/api or apps/web.
  4. Complete the rest of the form and click Create.

To change it later, edit the Base directory field on the service's or website's edit page.

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 your resources, console pages, and documentation