Skip to content

Commit 8afb683

Browse files
committed
Local deployment setup: should support fast building
1 parent edbf470 commit 8afb683

File tree

3 files changed

+193
-113
lines changed

3 files changed

+193
-113
lines changed

Dockerfile.devtools

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ RUN /workspace/depot_tools/ensure_bootstrap
4848
# Build standard DevTools first (cached)
4949
RUN npm run build
5050

51+
# Add Browser Operator fork and checkout main branch
52+
# This ensures the base has all Browser Operator customizations (ai_chat panel, etc.)
53+
RUN git remote add upstream https://github.com/BrowserOperator/browser-operator-core.git
54+
RUN git fetch upstream
55+
RUN git checkout upstream/main
56+
57+
# Build Browser Operator version to ensure everything works
58+
# This catches any build issues in the base layer
59+
RUN npm run build
60+
5161
# Create marker file to indicate base is built
5262
RUN touch /workspace/.devtools-base-built
5363

@@ -56,21 +66,18 @@ RUN touch /workspace/.devtools-base-built
5666
# ==============================================================================
5767
FROM devtools-base AS devtools-local
5868

59-
WORKDIR /workspace/devtools/devtools-frontend
60-
61-
# Add Browser Operator fork
62-
RUN git remote add upstream https://github.com/BrowserOperator/browser-operator-core.git
63-
RUN git fetch upstream
64-
RUN git checkout upstream/main
69+
# Copy local changes from browser-operator-core submodule FIRST
70+
# This happens before checking out upstream, so we copy over the upstream code
71+
COPY browser-operator-core/front_end /workspace/devtools/devtools-frontend/front_end
72+
COPY browser-operator-core/eval-server /workspace/devtools/devtools-frontend/eval-server
6573

66-
# This is where local changes would be copied in development mode
67-
# When building from submodule, copy local changes here:
68-
# COPY will be added by build script if browser-operator-core/ exists locally
74+
WORKDIR /workspace/devtools/devtools-frontend
6975

7076
# Force automated mode
7177
RUN sed -i 's/AUTOMATED_MODE: false/AUTOMATED_MODE: true/' front_end/panels/ai_chat/core/BuildConfig.ts || true
7278

73-
# Build Browser Operator version with current changes
79+
# Build Browser Operator version with local changes
80+
# This build is much faster since we're only building the changed files
7481
RUN npm run build
7582

7683
# Create marker file

Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,19 @@ build-devtools: init-devtools ## Build DevTools image (smart: uses cache)
4343
docker build -f Dockerfile.devtools --target devtools-server -t browser-operator-devtools:latest .
4444
@echo "✅ DevTools built: browser-operator-devtools:latest"
4545

46-
rebuild-devtools: ## Force rebuild DevTools (use after code changes)
47-
@echo "🔄 Force rebuilding DevTools..."
46+
rebuild-devtools: ## Fast rebuild DevTools with local changes (recommended)
47+
@echo "🔄 Rebuilding DevTools with local changes (using cached base)..."
48+
@if ! docker images | grep -q "browser-operator-devtools.*base"; then \
49+
echo "❌ DevTools base not found. Building base first..."; \
50+
$(MAKE) --no-print-directory build-devtools-base; \
51+
fi
52+
docker build -f Dockerfile.devtools --target devtools-server -t browser-operator-devtools:latest .
53+
@echo "✅ DevTools rebuilt with your local changes"
54+
55+
rebuild-devtools-full: ## Force complete rebuild from scratch (slow, rarely needed)
56+
@echo "🔄 Force rebuilding DevTools from scratch (this will take ~30 minutes)..."
4857
docker build -f Dockerfile.devtools --no-cache --target devtools-server -t browser-operator-devtools:latest .
49-
@echo "✅ DevTools rebuilt"
58+
@echo "✅ DevTools completely rebuilt"
5059

5160
build: init build-devtools ## Build extended image with DevTools frontend
5261
@echo "🔨 Building extended kernel-browser with DevTools frontend..."

0 commit comments

Comments
 (0)