-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathDockerfile
More file actions
78 lines (60 loc) · 2.39 KB
/
Dockerfile
File metadata and controls
78 lines (60 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Multi-stage build for Chrome DevTools Frontend
FROM --platform=linux/amd64 ubuntu:22.04 AS builder
# BuildKit is required for secret mounting
# Secrets are mounted at build time but not stored in layers
# Usage: DOCKER_BUILDKIT=1 docker-compose build
# Install required packages
RUN apt-get update && apt-get install -y \
curl \
git \
python3 \
python3-pip \
python-is-python3 \
wget \
unzip \
sudo \
ca-certificates \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js 18.x
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
# Clone depot_tools
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
ENV PATH="/workspace/depot_tools:${PATH}"
ENV DEPOT_TOOLS_UPDATE=0
# Follow README instructions exactly:
# fetching code
RUN mkdir devtools
WORKDIR /workspace/devtools
RUN fetch devtools-frontend
# Build steps
WORKDIR /workspace/devtools/devtools-frontend
RUN gclient sync
RUN /workspace/depot_tools/ensure_bootstrap
# Build standard DevTools first
RUN npm run build
# Add Browser Operator fork and switch to it
RUN git remote add upstream https://github.com/BrowserOperator/browser-operator-core.git
RUN git fetch upstream
RUN git checkout upstream/main
# Copy our local modifications into the container
COPY front_end/panels/ai_chat/core/EnvironmentConfig.ts /workspace/devtools/devtools-frontend/front_end/panels/ai_chat/core/EnvironmentConfig.ts
COPY front_end/panels/ai_chat/ui/SettingsDialog.ts /workspace/devtools/devtools-frontend/front_end/panels/ai_chat/ui/SettingsDialog.ts
COPY front_end/entrypoints/devtools_app/devtools_app.ts /workspace/devtools/devtools-frontend/front_end/entrypoints/devtools_app/devtools_app.ts
# Build Browser Operator version with our modifications
RUN npm run build
# Production stage
FROM --platform=linux/amd64 nginx:alpine
# Copy the built DevTools frontend
COPY --from=builder /workspace/devtools/devtools-frontend/out/Default/gen/front_end /usr/share/nginx/html
# Copy nginx config
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
# Copy and setup entrypoint script for runtime configuration
COPY docker/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
EXPOSE 8000
# Use entrypoint to generate runtime config and start nginx
ENTRYPOINT ["/docker-entrypoint.sh"]