Repository navigation
Expand file tree
/
Copy pathDockerfile.browser-sidecar
More file actions
42 lines (37 loc) · 2.17 KB
/
Copy pathDockerfile.browser-sidecar
File metadata and controls
42 lines (37 loc) · 2.17 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
# Browser sidecar image for public projects: one long-lived container per
# public conversation that holds a headless Chromium driven through
# Playwright. The conversation's browser tools (chat/browser_sessions.py)
# talk to the agent inside (browser-sidecar-agent.py) over a Unix socket in
# the mounted /browser-state directory -- no TCP port is published, so the
# host reaches the container and the container has no path to the host.
#
# Network posture is the public script-runner's: open internet, every
# private / link-local destination REJECTed, host loopback unmapped, no
# credential injected. The same entrypoint installs those rules and drops
# privileges before the agent starts.
FROM python:3.12-slim
# Bump this date to make every deployment rebuild the image from fresh layers
# the next time run.py starts: a newer python:3.12-slim base (run.py pulls it
# before a rebuild), current Debian packages and current pip packages, e.g.
# after a security fix in the base image, ca-certificates or certifi. run.py
# rebuilds when this file changes, but podman would otherwise reuse every
# cached layer because no instruction below changed; a changed ARG value
# used in the LABEL invalidates the cache from here down.
ARG QUEST_IMAGE_REVISION=2026-10-23
LABEL org.quest.image-revision=${QUEST_IMAGE_REVISION}
RUN apt-get update && \
apt-get install -y --no-install-recommends iptables ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Playwright + Chromium (and its shared-library dependencies). The browser
# binaries go to a world-readable directory so the unprivileged run user
# (setpriv'd to the host uid) can execute them.
ENV PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright
RUN pip install --no-cache-dir playwright==1.64.0 && \
playwright install --with-deps chromium && \
rm -rf /var/lib/apt/lists/* && \
chmod -R a+rX /opt/ms-playwright
COPY browser-sidecar-agent.py /opt/quest-browser/agent.py
COPY script-runner-entry-public.sh /usr/local/bin/script-runner-entry-public.sh
RUN chmod +x /usr/local/bin/script-runner-entry-public.sh && chmod -R a+rX /opt/quest-browser
ENTRYPOINT ["/usr/local/bin/script-runner-entry-public.sh"]
CMD ["python3", "-u", "/opt/quest-browser/agent.py"]