Skip to content

Docker image layer#148

Open
gloskull wants to merge 2 commits into
Utility-Protocol:mainfrom
gloskull:Docker-Image-Layer
Open

Docker image layer#148
gloskull wants to merge 2 commits into
Utility-Protocol:mainfrom
gloskull:Docker-Image-Layer

Conversation

@gloskull

Copy link
Copy Markdown
Contributor

Motivation
Reduce CI build time by reusing Docker and Next.js build layers across runs to improve developer feedback loops and lower resource usage.
Produce a minimal, non-root runtime image by leveraging Next.js standalone output so the runtime stage only contains required artifacts.
Document the caching architecture and operational runbook so teams can monitor cache reuse and troubleshoot build regressions.
Description
Add a multi-stage Dockerfile that uses BuildKit cache mounts for the npm cache and .next/cache, and produces a small non-root runner image from Next.js output: "standalone" (see next.config.ts).
Add a .dockerignore to keep dependencies, build outputs, test artifacts, VCS metadata, env files, and docs out of the build context.
Extend the Frontend CI workflow to restore the Next.js build cache with actions/cache@v4 and add a docker-image job that builds with docker/build-push-action@v6 using GitHub Actions layer cache (type=gha) with cache-from/cache-to configured.
Add helper npm scripts docker:build and docker:build:plain for local parity with the CI build process and add a runbook under docs/runbooks/docker-ci-layer-caching.md describing architecture, monitoring, deployment guidance, and troubleshooting.
Testing
npx tsc --noEmit completed successfully.
npm run lint failed due to pre-existing unused-variable lint errors in src/components/map/AssetHeatmapLayer.tsx (existing code issue, not introduced by these CI/Docker changes).
npm test (vitest --run) failed with 3 pre-existing test failures in tests/components/AssetHeatmapLayer.test.tsx and tests/unit/keyCache.test.ts (failures unrelated to Docker/CI additions).
npm run build (Next.js build) failed in this environment because the build could not fetch Google-hosted fonts, and docker build could not be executed here because Docker is not available in the execution environment.
Closes #127

@elizabetheonoja-art

Copy link
Copy Markdown
Contributor

resolve conflicts @gloskull

3 similar comments
@JerryIdoko

Copy link
Copy Markdown
Contributor

resolve conflicts @gloskull

@elizabetheonoja-art

Copy link
Copy Markdown
Contributor

resolve conflicts @gloskull

@elizabetheonoja-art

Copy link
Copy Markdown
Contributor

resolve conflicts @gloskull

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.

Docker Image Layer Caching Optimization for CI

3 participants