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
- Navigate to your project's Services page and click Create service.
- Fill in your repository, branch, and service name.
- Open the Advanced configuration section.
- In the Base directory field, enter the path to your service's subdirectory — for example,
packages/apiorservices/worker. - 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/apiorservices/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.