Skip to content

Add multi-arch pre-built images for faster builds#147

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/optimize-lenny-build-process
Draft

Add multi-arch pre-built images for faster builds#147
Copilot wants to merge 6 commits intomainfrom
copilot/optimize-lenny-build-process

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 13, 2026

Lenny's build process requires 10-20 minutes to compile all services from scratch. This PR pre-builds multi-architecture (amd64/arm64) images for static services, reducing build time to 2-5 minutes.

Changes

GitHub Actions workflow (.github/workflows/build-images.yml)

  • Builds lenny-api for linux/amd64 and linux/arm64
  • Triggers on changes to docker/, compose.yaml, lenny/, or requirements.txt
  • Pushes to GitHub Container Registry with caching
  • Uses GITHUB_TOKEN (no additional secrets required)

Updated compose.yaml

  • API service references ghcr.io/archivelabs/lenny/lenny-api:latest with local build fallback
  • Reader service remains local-only build (requires dynamic NEXT_PUBLIC_MANIFEST_ALLOWED_DOMAINS at build time)
  • Added comments clarifying pre-built vs local-build services

Makefile

  • Added make pull target to update pre-built images

Documentation

  • DOCKER_IMAGES.md: Build system architecture, repository setup instructions, manual build procedures
  • README.md: Notes on faster setup and multi-arch support

Architecture

Service Strategy Reason
API Pre-built + local Static config, no build-time env vars
Reader Local only Requires dynamic NEXT_PUBLIC_MANIFEST_ALLOWED_DOMAINS
DB/S3 Pre-built Official upstream images
Readium Pre-built Official upstream image

Repository Setup

Post-merge actions:

  1. Set workflow permissions to "Read and write" in Settings > Actions > General
  2. Make package public at github.com/orgs/ArchiveLabs/packages/container/lenny%2Flenny-api

First workflow run on main will populate the registry. Users on subsequent clones automatically benefit from pre-built images.

Original prompt

Builds take a long time for Lenny via the Makefile + compose.

We'd like to make it faster by prebuilding images for Lenny that are multi-architecture (i.e. linux/amd64,linux/arm64).

One challenge is that, when we're building, Lenny has an option to use a custom domain or cloudflared tunnel, which ends up being a env variable that needs to be passed to lenny-reader to be built.

In an ideal world, what would happen is that the minio, db, lenny-api, and readium images would all be somehow prepared and built and the only thing the client would have to do is run the Makefile and have the lenny-readium image + container get built via the Makefile.

Generally we won't need to rebuild images unless there's a change to the domain/tunnel ENV or a change to the compose.yml or something in the docker/ directory that changes how the project is built or run.

We may need to add a new key to github so we can upload the images to github's docker repository. Can you prototype this PR


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits January 13, 2026 16:47
…mpose.yaml

Co-authored-by: mekarpeles <978325+mekarpeles@users.noreply.github.com>
Co-authored-by: mekarpeles <978325+mekarpeles@users.noreply.github.com>
Co-authored-by: mekarpeles <978325+mekarpeles@users.noreply.github.com>
Co-authored-by: mekarpeles <978325+mekarpeles@users.noreply.github.com>
Co-authored-by: mekarpeles <978325+mekarpeles@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance build process for Lenny with prebuilt multi-arch images Add multi-arch pre-built images for faster builds Jan 13, 2026
Copilot AI requested a review from mekarpeles January 13, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants