Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

fix: add element-call multi-stage build to Dockerfile#271

Closed
Just-Insane wants to merge 2 commits into
7w1:devfrom
CloudHub-Social:fix/element-call-docker-build
Closed

fix: add element-call multi-stage build to Dockerfile#271
Just-Insane wants to merge 2 commits into
7w1:devfrom
CloudHub-Social:fix/element-call-docker-build

Conversation

@Just-Insane
Copy link
Copy Markdown
Collaborator

Problem

After merging the "avatars!" PR (#227), which added element-call as a git submodule and @element-hq/element-call-embedded as a file:element-call/embedded/web dependency, Docker builds fail with:

[vite-plugin-static-copy:build] No file was found to copy on node_modules/@element-hq/element-call-embedded/dist/* src.

The Dockerfile had no step to fetch or build the submodule, so embedded/web/dist/ was never populated.

Solution

Add a new element-call-builder stage before the main builder that:

  1. Fetches the pinned submodule commit (ecef381c) from the element-call repo with --depth=1
  2. Runs corepack enable to activate Yarn 4.x (the repo's packageManager field requires it — the Alpine Node image only ships Yarn 1.x)
  3. Runs yarn build:embedded from the repo root, which outputs to embedded/web/dist/

The builder stage then uses COPY --from=element-call-builder to place the pre-built package at element-call/embedded/web before npm ci runs, so npm resolves the file: dependency and vite finds the dist/ assets.

upstream/dev added the element-call submodule as a file: dependency
(@element-hq/element-call-embedded) but the Dockerfile had no step to
build it, causing the vite static-copy plugin to fail with:

  No file was found to copy on node_modules/@element-hq/element-call-embedded/dist/*

Add a new element-call-builder stage that:
- Fetches the pinned submodule commit with --depth=1
- Enables corepack to activate yarn 4.x (required by packageManager field)
- Runs yarn build:embedded to produce embedded/web/dist/

The builder stage then COPYs the pre-built package into place before
npm ci, so npm can resolve the file: dep and vite finds the assets.
@Just-Insane Just-Insane requested a review from 7w1 as a code owner March 9, 2026 02:14
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 9, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
sable 78bd6cb Mar 09 2026, 12:47 PM

@7w1
Copy link
Copy Markdown
Owner

7w1 commented Mar 9, 2026

Not needed yet since we reverted avatars. Maybe needed again later but we’ll see :p

@7w1 7w1 closed this Mar 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants