diff --git a/.dockerignore b/.dockerignore index af1dfc73a35..73d00fff147 100644 --- a/.dockerignore +++ b/.dockerignore @@ -46,3 +46,15 @@ Swabble/ Core/ Users/ vendor/ + +# Needed for building the Canvas A2UI bundle during Docker image builds. +# Keep the rest of apps/ and vendor/ excluded to avoid a large build context. +!apps/shared/ +!apps/shared/OpenClawKit/ +!apps/shared/OpenClawKit/Tools/ +!apps/shared/OpenClawKit/Tools/CanvasA2UI/ +!apps/shared/OpenClawKit/Tools/CanvasA2UI/** +!vendor/a2ui/ +!vendor/a2ui/renderers/ +!vendor/a2ui/renderers/lit/ +!vendor/a2ui/renderers/lit/** diff --git a/Dockerfile b/Dockerfile index 237a6a238ac..716ab2099f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ COPY scripts ./scripts RUN pnpm install --frozen-lockfile COPY . . -RUN OPENCLAW_A2UI_SKIP_MISSING=1 pnpm build +RUN pnpm build # Force pnpm for UI build (Bun may fail on ARM/Synology architectures) ENV OPENCLAW_PREFER_PNPM=1 RUN pnpm ui:build diff --git a/scripts/bundle-a2ui.sh b/scripts/bundle-a2ui.sh index 3936858309d..aeade1b0679 100755 --- a/scripts/bundle-a2ui.sh +++ b/scripts/bundle-a2ui.sh @@ -14,10 +14,14 @@ A2UI_RENDERER_DIR="$ROOT_DIR/vendor/a2ui/renderers/lit" A2UI_APP_DIR="$ROOT_DIR/apps/shared/OpenClawKit/Tools/CanvasA2UI" # Docker builds exclude vendor/apps via .dockerignore. -# In that environment we must keep the prebuilt bundle. +# In that environment we can keep a prebuilt bundle only if it exists. if [[ ! -d "$A2UI_RENDERER_DIR" || ! -d "$A2UI_APP_DIR" ]]; then - echo "A2UI sources missing; keeping prebuilt bundle." - exit 0 + if [[ -f "$OUTPUT_FILE" ]]; then + echo "A2UI sources missing; keeping prebuilt bundle." + exit 0 + fi + echo "A2UI sources missing and no prebuilt bundle found at: $OUTPUT_FILE" >&2 + exit 1 fi INPUT_PATHS=(