This document explains the Continuous Integration and Continuous Deployment (CI/CD) pipeline for AnythingLLM, including GitHub Actions workflows, multi-stage Docker builds, frontend compilation with Vite, and deployment artifact generation. The build process produces Docker images for both AMD64 and ARM64 architectures, as well as Helm charts for Kubernetes deployment.
For information about deploying the built artifacts, see Docker Deployment. For environment configuration that affects build behavior, see Environment Configuration.
The AnythingLLM build system consists of three independent build processes that are orchestrated into a single Docker image:
Sources: docker/Dockerfile1-183 package.json20-39 frontend/package.json server/package.json1-17 collector/package.json1-16
The primary CI/CD workflow is defined in .github/workflows/dev-build.yaml, which builds and publishes Docker images on every push to development branches.
Key Configuration:
| Aspect | Configuration |
|---|---|
| Trigger | Push to development branch (configurable) |
| Platforms | linux/amd64, linux/arm64 |
| Runner | ubuntu-22.04-arm |
| Concurrency | build-${{ github.ref }} (cancels in-progress builds) |
| Cache | GitHub Actions cache (type=gha) |
| SBOM | Enabled (sbom: true) |
| Provenance | Maximum detail (mode=max) |
Sources: .github/workflows/dev-build.yaml1-120
The workflow skips builds when only certain file types are modified:
Sources: .github/workflows/dev-build.yaml10-21
The workflow includes vulnerability exception handling using VEX (Vulnerability Exploitability eXchange) attestations:
Sources: .github/workflows/dev-build.yaml86-119
The Dockerfile uses a sophisticated multi-stage build strategy to optimize image size and support multiple architectures.
Sources: docker/Dockerfile1-183
Both architecture-specific stages install common system dependencies:
User and Permission Setup:
anythingllm user with UID/GID 1000 (configurable via ARG_UID/ARG_GID)/app/frontend/, /app/server/, /app/collector/docker-entrypoint.sh, docker-healthcheck.shSources: docker/Dockerfile14-125
ARM64 builds require a special Chromium binary because Puppeteer doesn't ship with ARM-compatible builds:
Sources: docker/Dockerfile8-72
The frontend build runs on the native host architecture (not emulated) to avoid esbuild crashes under QEMU:
Key Point: The output (static HTML/CSS/JS) is platform-independent, so cross-compilation is safe.
Sources: docker/Dockerfile137-147
Installs production dependencies for both server and collector:
Sources: docker/Dockerfile149-162
Combines all artifacts into the final image:
Sources: docker/Dockerfile167-182
The frontend uses Vite for fast development and optimized production builds.
| Script | Command | Purpose |
|---|---|---|
dev | vite | Development server with HMR |
build | vite build | Production build with optimization |
build:publish | Custom script | Builds embed widget for publishing |
Sources: frontend/package.json
The build process produces:
frontend/dist/
├── index.html # Entry point
├── assets/
│ ├── index-[hash].js # Bundled JavaScript
│ ├── index-[hash].css # Bundled CSS
│ └── [assets]-[hash] # Images, fonts, etc.
└── [other static files]
This output is copied to /app/server/public/ in the Docker image and served by Express as static files.
Sources: docker/Dockerfile169
The server uses production dependency installation to minimize image size:
Key Dependencies:
yarn install via postinstall hookSources: server/package.json21-89 docker/Dockerfile152-154
The collector service has specific requirements for document processing:
Key Dependencies:
Sources: collector/package.json17-49 docker/Dockerfile158-161
Starting development environment:
Development Features:
server/.env.developmentSources: package.json23-28 server/package.json13 collector/package.json13
Building for production:
Production Optimizations:
[hash] filenamesSources: package.json34-35 server/package.json14
| Variable | Dev Default | Prod Default | Effect |
|---|---|---|---|
NODE_ENV | development | production | Enables production optimizations |
ANYTHING_LLM_RUNTIME | (none) | docker | Signals Docker environment |
DEPLOYMENT_VERSION | (none) | 1.11.0 | Tracks deployed version |
Sources: docker/Dockerfile172-174
The build process uses Docker Buildx to create images for multiple platforms:
Architecture-Specific Stages:
Sources: docker/Dockerfile131 .github/workflows/dev-build.yaml77
ARM64 builds require patching Puppeteer's Chromium binary:
| Issue | Solution |
|---|---|
| Puppeteer doesn't ship ARM-compatible Chromium | Download pre-built ARM Chromium from AnythingLLM CDN |
| Binary location mismatch | Set PUPPETEER_EXECUTABLE_PATH=/app/chrome-linux/chrome |
| Unnecessary download | Set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true |
Download source: https://webassets.anythingllm.com/chromium-1088-linux-arm64.zip
Sources: docker/Dockerfile63-70
To avoid esbuild crashes under QEMU emulation, the frontend build uses the native host architecture:
This means:
Sources: docker/Dockerfile141
The CI/CD pipeline produces Docker images with specific tags:
Tag Strategy:
dev: Latest development build (from dev branches)X.Y.Z: Semantic version tags (from releases)latest: Latest stable releaseSources: .github/workflows/dev-build.yaml66-67
The project includes a Helm chart for Kubernetes deployment at cloud-deployments/helm/charts/anythingllm/.
Chart Configuration:
Deployment Process:
Sources: cloud-deployments/helm/charts/anythingllm/values.yaml1-232 cloud-deployments/helm/charts/anythingllm/README.md1-149
The GitHub Actions workflow uses layer caching to speed up builds:
Cache Layers:
Cache hit rate: Typically 80-90% for unchanged dependencies, reducing build time from ~15 minutes to ~3-5 minutes.
Sources: .github/workflows/dev-build.yaml80-81
| Script | Purpose | Usage |
|---|---|---|
setup | First-time setup | yarn setup |
dev:all | Run all services in dev mode | yarn dev:all |
prod:frontend | Build frontend for production | yarn prod:frontend |
prod:server | Run production server | yarn prod:server |
prisma:setup | Initialize database schema | yarn prisma:setup |
lint | Run linters on all components | yarn lint |
Sources: package.json20-39
| Script | Purpose | Usage |
|---|---|---|
dev | Development server with nodemon | yarn dev |
start | Production server | yarn start |
swagger | Generate API documentation | yarn swagger |
Sources: server/package.json12-17
| Script | Purpose | Usage |
|---|---|---|
dev | Development collector service | yarn dev |
start | Production collector service | yarn start |
Sources: collector/package.json12-15
Typical installation times:
Sources: docker/Dockerfile144 docker/Dockerfile154 docker/Dockerfile161
| Aspect | Benefit |
|---|---|
| Image size | Intermediate build tools not included in final image |
| Security | Only runtime dependencies in production |
| Build speed | Parallel stage execution where possible |
| Cache efficiency | Layer reuse across builds |
Final image size: ~1.8GB (compressed: ~650MB)
Sources: docker/Dockerfile1-183
Refresh this wiki