# syntax=docker/dockerfile:1 FROM node:24.21.0-alpine WORKDIR /app RUN apk add --no-cache git python3 make g++ bash sed # Provide a no-op xdg-open so the dev server doesn't crash trying to open a browser RUN printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/xdg-open && chmod +x /usr/local/bin/xdg-open RUN corepack enable && corepack prepare yarn@4.4.0 --activate # Copy dependency manifests first for better layer caching COPY package.json yarn.lock .yarnrc.yml ./ COPY --parents src/*/package.json ./ COPY --parents examples/demo-app/package.json examples/demo-app/yarn.lock examples/demo-app/.yarnrc.yml ./ # Skip all postinstall scripts to avoid building the gl native package (GPU headers not available) RUN --mount=type=cache,id=kepler-yarn,target=/yarn-cache \ yarn config set enableScripts false && \ YARN_CACHE_FOLDER=/yarn-cache yarn install && \ yarn config set enableScripts true # Selectively run esbuild postinstall (needed for the correct platform binary) RUN cd node_modules/esbuild && node install.js # Now copy the full source COPY . . RUN yarn fix-dependencies RUN yarn workspaces foreach -At run stab WORKDIR /app/examples/demo-app RUN --mount=type=cache,id=kepler-yarn,target=/yarn-cache \ YARN_CACHE_FOLDER=/yarn-cache yarn install EXPOSE 8080 CMD ["yarn", "start:local"]