Overview
migetpacks supports monorepo projects through thePROJECT_PATH environment variable. This allows you to target a specific subdirectory within your source tree for language detection, version detection, and building.
Basic Usage
SetPROJECT_PATH to the subdirectory you want to build:
PROJECT_PATH is relative to SOURCE_DIR (defaults to /workspace/source). The builder will detect language and version from the specified subdirectory.Example Monorepo Structure
Building Each Service
Combining with DOCKERFILE_PATH
For services that have custom Dockerfiles in non-standard locations:When both
PROJECT_PATH and DOCKERFILE_PATH are set, DOCKERFILE_PATH is resolved relative to the PROJECT_PATH subdirectory. In the example above, the Dockerfile is located at services/api/docker/Dockerfile.prod.CI/CD with Monorepos
GitHub Actions Matrix
Build multiple services in parallel using a matrix strategy:Shipwright BuildRun
How Language Detection Works with PROJECT_PATH
WhenPROJECT_PATH is set, language detection examines only the files within that subdirectory:
1
Source directory is resolved
The effective source becomes
SOURCE_DIR/PROJECT_PATH (e.g., /workspace/source/services/api).2
Language detection runs
Files like
go.mod, package.json, requirements.txt, etc. are searched within the subdirectory.3
Version detection runs
Version files (
.nvmrc, .ruby-version, go.mod, etc.) are read from the subdirectory.4
Build context is set
The Docker build context is the subdirectory, so only those files are included in the image.
Tips
- Each service gets its own
OUTPUT_IMAGE, so they can be deployed independently - Language detection is automatic per subdirectory, no need to set
LANGUAGEmanually - Shared dependencies (e.g., Go workspaces) should be handled via the service’s own dependency management
- Use
BUILD_CACHE_DIRwith a shared volume to speed up builds across services