Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
463 lines (412 loc) · 22.2 KB
/
Copy pathDockerfile
File metadata and controls
463 lines (412 loc) · 22.2 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# =============================================================================
# Rome — Multi-stage Docker build
# =============================================================================
# Optional build-time mirrors for unreliable or proxied networks. Both default
# to empty so upstream builds keep using the official sources unchanged; set
# them via --build-arg (or the ROME_APT_MIRROR / ROME_NPM_REGISTRY env vars in
# scripts/dev/run-local-docker.sh) to route apt and the npm registry through a
# closer/more stable mirror. APT_MIRROR is a bare host that replaces
# deb.debian.org / security.debian.org (e.g. mirrors.tuna.tsinghua.edu.cn).
ARG APT_MIRROR=""
ARG NPM_REGISTRY=""
# ---------------------------------------------------------------------------
# Stage 0: Dependency cache inputs
# ---------------------------------------------------------------------------
FROM node:24-slim AS docker-manifests
WORKDIR /context
# Compose builds from the repository root for an intuitive
# `docker compose up -d --build` path. This stage reduces that full context
# back to dependency manifests so source edits do not invalidate pnpm install.
COPY . .
RUN set -eux; \
mkdir -p /docker-manifests; \
cp package.json pnpm-lock.yaml pnpm-workspace.yaml /docker-manifests/; \
find packages rome_apps -path '*/package.json' -type f -exec sh -c '\
for src do \
dest="/docker-manifests/$src"; \
mkdir -p "$(dirname "$dest")"; \
cp "$src" "$dest"; \
done \
' sh {} +; \
# Workspace packages may declare "bin" entries (e.g. @rome-os/app-web-sdk's
# `rome` CLI). pnpm only links node_modules/.bin/* if the target file
# exists at install time, so include any bin/ launchers alongside the
# manifests. Source-only edits leave these untouched, preserving the cache.
find packages rome_apps -type d -name bin -not -path '*/node_modules/*' -exec sh -c '\
for src do \
dest="/docker-manifests/$src"; \
mkdir -p "$(dirname "$dest")"; \
cp -r "$src" "$dest"; \
done \
' sh {} +
# ---------------------------------------------------------------------------
# Stage 1: Fetch dependencies into pnpm content-addressed store
# ---------------------------------------------------------------------------
# `pnpm fetch` downloads the runtime workspace closure into /pnpm/store.
# Copy the manifest workspace instead of only pnpm-lock.yaml so Docker cache
# invalidates when a package manifest changes without a lockfile delta.
# It may also populate node_modules/.pnpm as a virtual store, so remove that
# transient tree before the filtered builder install recreates the runtime
# closure from the warm store.
FROM node:24-slim AS fetch
ARG APT_MIRROR=""
ARG NPM_REGISTRY=""
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean && \
if [ -n "$APT_MIRROR" ]; then \
printf 'Acquire::Retries "8";\nAcquire::http::Timeout "60";\nAcquire::https::Timeout "60";\nAcquire::http::Proxy "DIRECT";\nAcquire::https::Proxy "DIRECT";\n' > /etc/apt/apt.conf.d/99rome-resilience; \
sed -i "s|deb.debian.org|${APT_MIRROR}|g; s|security.debian.org|${APT_MIRROR}|g" /etc/apt/sources.list /etc/apt/sources.list.d/debian.sources 2>/dev/null || true; \
fi && \
apt-get update && \
apt-get install -y --no-install-recommends python3 make g++ git
ENV COREPACK_ENABLE_STRICT=0
RUN corepack enable && corepack prepare pnpm@11.6.0 --activate
WORKDIR /build
COPY --from=docker-manifests /docker-manifests ./
# Persist the registry override into the pnpm/npm config so it carries into the
# builder stage (FROM fetch) without re-declaring the arg there. The resilience
# settings (more retries, longer timeouts, lower concurrency) only kick in when
# a mirror is configured — i.e. the flaky/proxied-network case — so default and
# CI builds keep pnpm's stock behavior. Lower network-concurrency matters most:
# fewer parallel large-tarball TLS streams survive far better on unstable links.
RUN if [ -n "$NPM_REGISTRY" ]; then \
pnpm config set registry "$NPM_REGISTRY" && \
pnpm config set fetch-retries 6 && \
pnpm config set fetch-retry-mintimeout 20000 && \
pnpm config set fetch-retry-maxtimeout 120000 && \
pnpm config set fetch-timeout 600000 && \
pnpm config set network-concurrency 4; \
fi
RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store \
pnpm config set store-dir /pnpm/store && \
pnpm fetch \
--filter @rome/core... \
--filter @rome/discord-cli... \
--filter @rome/signer... \
--filter @rome-os/node... \
--filter rome-web... \
--filter @rome-os/app-web-sdk... \
--filter @rome-os/app-runtime... \
--filter './rome_apps/*...' && \
rm -rf node_modules
# ---------------------------------------------------------------------------
# Stage 2: Build application
# ---------------------------------------------------------------------------
FROM fetch AS builder
ARG ROME_DOCKER_APP_CODE_MODE=source
ENV ROME_DOCKER_APP_CODE_MODE=${ROME_DOCKER_APP_CODE_MODE}
COPY . .
# Link node_modules from the warm store. `--prefer-offline` uses the fetched
# store first while still allowing pnpm to download exact locked tarballs that
# `pnpm fetch` does not materialize, such as GitHub archive dependencies.
# `--frozen-lockfile` matches the manifests against the lockfile.
# Lifecycle scripts (e.g. each SDK's `prepare: tsc`) can run here because
# src/ and tsconfig.json are now present on disk.
RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store \
pnpm config set store-dir /pnpm/store && \
pnpm install --prefer-offline --frozen-lockfile \
--filter @rome/core... \
--filter @rome/discord-cli... \
--filter @rome/signer... \
--filter @rome-os/node... \
--filter rome-web... \
--filter @rome-os/app-web-sdk... \
--filter @rome-os/app-runtime... \
--filter './rome_apps/*...'
# Remove desktop-only deps not needed in Docker (electron ~500MB).
# Enumerate names explicitly — a previous `electron-*@*` glob also matched
# `electron-to-chromium@*`, which `browserslist` needs at vite-build time
# (loaded transitively by vite-plugin-svgr).
RUN rm -rf node_modules/.pnpm/electron@* \
node_modules/.pnpm/electron-builder@* \
node_modules/.pnpm/electron-builder-*@* \
node_modules/.pnpm/electron-publish@* \
node_modules/.pnpm/electron-updater@* \
node_modules/.pnpm/electron-winstaller@* \
node_modules/.pnpm/app-builder-bin@* \
node_modules/.pnpm/7zip-bin@* \
node_modules/.pnpm/@electron*
RUN pnpm build:docker-runtime
# ---------------------------------------------------------------------------
# Stage 3: Production image
# ---------------------------------------------------------------------------
FROM node:24-slim AS production
ARG TARGETARCH
ARG ROME_DOCKER_APP_CODE_MODE=source
ARG COMPOSIO_CLI_VERSION=@composio/cli@0.2.32
# Vendored standalone CLIs (see the Slack/Notion install step below).
ARG SLACK_CLI_VERSION=4.4.0
ARG NTN_CLI_VERSION=0.19.0
ARG APT_MIRROR=""
ARG NPM_REGISTRY=""
# When non-empty, install the Debian-repo `chromium` on amd64 instead of pulling
# google-chrome from dl.google.com. Lets amd64 builds on networks that cannot
# reach Google use the same browser path as arm64 (which already ships chromium).
ARG ROME_FORCE_CHROMIUM=""
# s6-overlay is PID 1 and supervises the long-running services. See
# scripts/docker/s6-rc.d.
ARG S6_OVERLAY_VERSION=3.2.1.0
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean && \
if [ -n "$APT_MIRROR" ]; then \
printf 'Acquire::Retries "8";\nAcquire::http::Timeout "60";\nAcquire::https::Timeout "60";\nAcquire::http::Proxy "DIRECT";\nAcquire::https::Proxy "DIRECT";\n' > /etc/apt/apt.conf.d/99rome-resilience; \
sed -i "s|deb.debian.org|${APT_MIRROR}|g; s|security.debian.org|${APT_MIRROR}|g" /etc/apt/sources.list /etc/apt/sources.list.d/debian.sources 2>/dev/null || true; \
fi && \
apt-get update && \
apt-get install -y --no-install-recommends curl gnupg ca-certificates && \
if [ "$TARGETARCH" = "amd64" ] && [ -z "$ROME_FORCE_CHROMIUM" ]; then \
install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL --retry 5 --retry-delay 2 https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /etc/apt/keyrings/google-chrome.gpg && \
chmod a+r /etc/apt/keyrings/google-chrome.gpg && \
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list; \
fi && \
apt-get update && \
if [ "$TARGETARCH" = "amd64" ] && [ -z "$ROME_FORCE_CHROMIUM" ]; then \
BROWSER_PACKAGE="google-chrome-stable"; \
BROWSER_BINARY="/usr/bin/google-chrome-stable"; \
else \
BROWSER_PACKAGE="chromium"; \
BROWSER_BINARY="/usr/bin/chromium"; \
fi && \
apt-get install -y --no-install-recommends xz-utils git git-lfs gh jq ripgrep openssh-server gosu rsync iptables iproute2 sudo caddy sshfs fuse3 tigervnc-standalone-server novnc websockify openbox xterm socat python3 python3-websocket xclip unzip fonts-noto fonts-noto-cjk fonts-noto-color-emoji fonts-liberation "$BROWSER_PACKAGE" && \
git lfs version && \
printf '%s\n' "$BROWSER_BINARY" > /etc/rome-browser-binary
# Install AI tool CLIs globally (early for better layer caching).
# @yunfanye/opencli is not mirrored on npmmirror, so install it separately from the
# default registry. A scoped --@yunfanye:registry override on the mirrored install
# does NOT work: npm's replace-registry-host rewrites the npmjs tarball host to the
# top-level --registry (the mirror), producing a 404.
RUN --mount=type=cache,target=/root/.npm \
npm install -g ${NPM_REGISTRY:+--registry "$NPM_REGISTRY"} @anthropic-ai/claude-code@2.1.293 @openai/codex@0.160.0 && \
npm install -g @yunfanye/opencli@1.8.8
RUN curl -fsSL --retry 5 --retry-delay 2 https://composio.dev/install | COMPOSIO_INSTALL_DIR=/usr/local/lib/composio bash -s -- "$COMPOSIO_CLI_VERSION" && \
ln -sf /usr/local/lib/composio/composio /usr/local/bin/composio && \
chmod -R a+rX /usr/local/lib/composio
# Vendor the Slack + Notion CLIs (both standalone binaries) so in-container
# agents can drive the Slack Web API (`slack api <method>`) and Notion (`ntn`)
# directly. Same shape as the Composio install above: pinned versions, unpacked
# under /usr/local/lib and symlinked onto PATH. The upstream installer scripts
# are unsuitable here (Slack's has no install-dir override and would land under
# /root, unreadable by the rome user), so we fetch the pinned release tarballs
# directly — Slack from its CDN (no published checksum, HTTPS + retries like the
# other vendored fetches), Notion with its published sha256 verified.
# Kept in sync with infra/rome/Dockerfile.
RUN set -eux; \
arch="$(dpkg --print-architecture)"; \
case "$arch" in \
amd64) ntn_target="x86_64-unknown-linux-musl" ;; \
arm64) ntn_target="aarch64-unknown-linux-musl" ;; \
*) echo "unsupported arch for slack/notion CLIs: $arch" >&2; exit 1 ;; \
esac; \
mkdir -p /usr/local/lib/slack-cli; \
curl -fsSL --retry 5 --retry-delay 2 \
"https://downloads.slack-edge.com/slack-cli/slack_cli_${SLACK_CLI_VERSION}_linux_${arch}.tar.gz" \
| tar -xz -C /usr/local/lib/slack-cli; \
ln -sf /usr/local/lib/slack-cli/bin/slack /usr/local/bin/slack; \
tmp="$(mktemp -d)"; \
ntn_archive="ntn-${ntn_target}.tar.gz"; \
curl -fsSL --retry 5 --retry-delay 2 -o "$tmp/$ntn_archive" \
"https://ntn.dev/releases/v${NTN_CLI_VERSION}/$ntn_archive"; \
curl -fsSL --retry 5 --retry-delay 2 -o "$tmp/$ntn_archive.sha256" \
"https://ntn.dev/releases/v${NTN_CLI_VERSION}/$ntn_archive.sha256"; \
( cd "$tmp" && sha256sum -c "$ntn_archive.sha256" ); \
mkdir -p /usr/local/lib/notion-cli; \
tar -xz --strip-components=1 -C /usr/local/lib/notion-cli -f "$tmp/$ntn_archive"; \
ln -sf /usr/local/lib/notion-cli/ntn /usr/local/bin/ntn; \
rm -rf "$tmp"; \
chmod -R a+rX /usr/local/lib/slack-cli /usr/local/lib/notion-cli; \
test -x /usr/local/lib/slack-cli/bin/slack; \
ntn --version
ENV COREPACK_ENABLE_STRICT=0
RUN corepack enable && corepack prepare pnpm@11.6.0 --activate
# The image ships no uv, but rome can install it under ~/.local. uv's default
# directories for its commands, tools and Pythons are already under ~/.local,
# which an upgrade keeps. This system-wide default stops uv from building an
# environment on /usr/bin/python3, which an upgrade replaces. An account's own
# uv.toml takes precedence.
RUN mkdir -p /etc/uv && printf 'python-preference = "only-managed"\n' > /etc/uv/uv.toml
# Create rome user early so COPY --chown can avoid expensive recursive chown
RUN groupadd --system rome && \
useradd --system --no-log-init --gid rome --create-home --shell /bin/bash rome
# The daemon runs as rome with HOME on the persistent volume. Corepack's
# default cache lives under HOME, and an empty cache pins whatever pnpm is
# latest on first use, so each instance would install apps with a different
# pnpm. App installs run pnpm against this cache instead (runPnpm in
# packages/core/src/apps/packaging/pack.ts). rome owns it so an app that
# declares another packageManager version can still download that version.
# Such downloads live in the image layer, not the volume, so they repeat after
# each container recreate (first-party apps all declare this version).
ENV ROME_PNPM_COREPACK_HOME=/opt/rome-corepack
RUN mkdir -p /opt/rome-corepack && \
COREPACK_HOME=/opt/rome-corepack corepack prepare pnpm@11.6.0 --activate && \
chown -R rome:rome /opt/rome-corepack
RUN echo "rome ALL=(root) NOPASSWD: /bin/sh /app/scripts/docker/rome-hostfs-remote-access-provision.sh *" > /etc/sudoers.d/rome-hostfs && \
chmod 0440 /etc/sudoers.d/rome-hostfs
# s6-overlay, with its published sha256 verified like the Notion CLI above.
RUN set -eux; \
case "$(dpkg --print-architecture)" in \
amd64) s6_arch="x86_64" ;; \
arm64) s6_arch="aarch64" ;; \
*) echo "unsupported arch for s6-overlay" >&2; exit 1 ;; \
esac; \
tmp="$(mktemp -d)"; \
for archive in s6-overlay-noarch.tar.xz "s6-overlay-${s6_arch}.tar.xz"; do \
curl -fsSL --retry 5 --retry-delay 2 -o "$tmp/$archive" \
"https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/$archive"; \
curl -fsSL --retry 5 --retry-delay 2 -o "$tmp/$archive.sha256" \
"https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/$archive.sha256"; \
( cd "$tmp" && sha256sum -c "$archive.sha256" ); \
tar -C / -Jxpf "$tmp/$archive"; \
done; \
rm -rf "$tmp"
# Build into /opt/rome — the bind-mounted /app volume hides image contents at
# runtime, so rome-init.sh copies from /opt/rome to /app on first run.
WORKDIR /opt/rome
# Copy entire built application with correct ownership (avoids expensive chown -R layer)
COPY --chown=rome:rome --from=builder /build/ ./
ENV ROME_DOCKER_APP_CODE_MODE=${ROME_DOCKER_APP_CODE_MODE}
# Where the boot script (scripts/generate-caddyfile.ts) writes the production
# proxy config.
ENV CADDY_CONFIG_PATH=/etc/caddy/Caddyfile
RUN case "$ROME_DOCKER_APP_CODE_MODE" in \
source) ;; \
compiled) \
rm -rf /opt/rome/packages/core/src && \
rm -rf /opt/rome/packages/web/src && \
rm -f /opt/rome/scripts/*.ts \
/opt/rome/scripts/*.test.ts \
/opt/rome/scripts/*.integration.test.ts \
/opt/rome/scripts/*.e2e.test.ts; \
;; \
*) \
echo "Unsupported ROME_DOCKER_APP_CODE_MODE: $ROME_DOCKER_APP_CODE_MODE" >&2; \
exit 1; \
;; \
esac
# The Discord CLI has no source runtime mode; every image executes dist only.
RUN rm -rf /opt/rome/packages/discord-cli/src
# Fingerprint synced app content (excluding image-backed node_modules) to skip redundant sync on restart.
RUN find /opt/rome \
-name node_modules -prune -o \
-type f -print0 | \
sort -z | \
xargs -0 sha256sum | \
sha256sum | \
awk '{print $1}' > /opt/rome/.image-sync-id
# Copy Caddyfile for public reverse proxy
COPY Caddyfile /etc/caddy/Caddyfile
COPY infra/chrome/opencli-policy.json /etc/opt/chrome/policies/managed/rome-opencli.json
COPY infra/chrome/opencli-policy.json /etc/chromium/policies/managed/rome-opencli.json
# Service definitions and the root-run scripts they call. They live outside
# /opt/rome, which the rome user owns, so rome cannot change what root runs.
COPY scripts/docker/s6-rc.d/ /etc/s6-overlay/s6-rc.d/
COPY scripts/docker/rome-init.sh /etc/s6-overlay/scripts/rome-init
COPY scripts/docker/rome-init-lib.sh /etc/s6-overlay/scripts/rome-init-lib
COPY scripts/docker/rome-init-tools.sh /etc/s6-overlay/scripts/rome-init-tools
COPY scripts/docker/rome-wait-for-rome.sh /etc/s6-overlay/scripts/rome-wait-for-rome
COPY scripts/docker/rome-run-as.sh /usr/local/bin/rome-run-as
# rome-init-tools.sh has the rome and user shells source this. It sits outside /app
# because user cannot read /app.
COPY scripts/docker/rome-shell-path.sh /usr/local/share/rome/rome-shell-path.sh
# Agent-facing Discord REST CLI. /app is populated from /opt/rome by
# rome-init.sh; the package launcher always loads its compiled dist entrypoint.
RUN ln -sf /app/packages/discord-cli/bin/discord.js /usr/local/bin/discord
RUN ln -sf /app/packages/rome-node-cli/bin/rome-node.js /usr/local/bin/rome-node
# The vault CLI ships inside the signer package, next to the signer it talks to.
RUN ln -sf /app/packages/signer/bin/vault.js /usr/local/bin/vault
# Chrome/CDP launcher assets
RUN chmod +x /opt/rome/scripts/docker/rome-start-chrome-cdp.sh /opt/rome/scripts/docker/rome-apply-cdp-stealth.sh
# Restore the execute bit on vendored ripgrep binaries. The Anthropic npm
# tarballs (@anthropic-ai/claude-agent-sdk as a pnpm dep, and the globally
# installed @anthropic-ai/claude-code) publish vendor/ripgrep/<arch>/rg as
# 0644, so the SDK's Grep tool fails with EACCES when it spawns rg directly.
# Mark every vendored rg executable in both the image node_modules (used at
# runtime via the /app/node_modules symlink) and the npm-global tree.
RUN find /opt/rome/node_modules /usr/local/lib/node_modules \
-type f -path '*/vendor/ripgrep/*/rg' -exec chmod a+rx {} + 2>/dev/null || true
# The container's browser is the server-side Chrome: BROWSER points every
# URL open at the CDP opener, so any CLI OAuth flow that shells out to the
# system browser (`codex login`, `claude /login`, `gh auth login`, …) lands
# as a tab in the noVNC-visible Chrome. $BROWSER is honored both by browser
# launchers directly (e.g. codex's webbrowser crate checks it first) and by
# xdg-open's headless fallback path — the xdg mimeapps route is NOT viable
# here: xdg-open only consults mimeapps when $DISPLAY is set, and the
# backend runs without one.
RUN install -m 0755 /opt/rome/scripts/docker/rome-open-in-server-browser.sh /usr/local/bin/rome-open-in-server-browser
ENV BROWSER=/usr/local/bin/rome-open-in-server-browser
RUN test ! -e /opt/rome/packages/desktop && \
test ! -e /opt/rome/packages/pantheon && \
test ! -e /opt/rome/packages/cdp-client
# Set remaining permissions
RUN chown -R rome:rome /etc/caddy && \
chmod 750 /home/rome
# Create user account for SSH access
RUN getent group fuse >/dev/null || groupadd --system fuse && \
useradd --no-log-init --create-home --shell /bin/bash user && \
chmod 750 /home/user && \
usermod -aG user rome && \
usermod -aG fuse rome
RUN printf 'user_allow_other\n' > /etc/fuse.conf
# State directories of the signer service (docker-compose.yml). A named volume
# mounted over an empty path copies the image directory's owner, so a fresh
# volume is writable by the signer's fixed uid and by nobody else.
RUN mkdir -p /keys /run/rome-signer && \
chown 10001:10001 /keys /run/rome-signer && \
chmod 0700 /keys
# SSH setup
RUN mkdir -p /run/sshd && \
mkdir -p /etc/ssh/ssh_host_keys
COPY sshd_config /etc/ssh/sshd_config
WORKDIR /app
ENV NODE_ENV=production
ENV PANTHEON_BASE_ORIGIN=https://romeos.cc
ENV INTERNAL_API_WEB_ROOT=/app/packages/web/dist
# Declared here, right before their only use, on purpose: every RUN after an
# ARG carries its value in its build-cache key, so declaring these per-release
# values at the top of the stage rebuilt every system layer on every release.
# Build identity, surfaced in the dashboard's Advanced settings footer. The
# production image ships without a .git directory (see .dockerignore), so these
# freeze the running build's SHA + build time at image-build time. ROME_VERSION
# is the release semver (no v prefix, matching the image's docker tag); it is
# empty on non-release builds.
ARG ROME_VERSION
ARG ROME_BUILD_SHA
ARG ROME_BUILD_TIME
# GA4 measurement ID, consumed at container RUNTIME only: the boot
# script writes it into the SPA's runtime-config.js. The
# build-arg merely sets the image's default ENV (CI secret on published images,
# empty everywhere else) — starting a container with ROME_GA_MEASUREMENT_ID
# overridden or emptied changes/disables analytics without a rebuild (R7).
ARG ROME_GA_MEASUREMENT_ID=""
ENV ROME_VERSION=${ROME_VERSION}
ENV ROME_BUILD_SHA=${ROME_BUILD_SHA}
ENV ROME_BUILD_TIME=${ROME_BUILD_TIME}
ENV ROME_GA_MEASUREMENT_ID=${ROME_GA_MEASUREMENT_ID}
ENV DISPLAY=:99
ENV ROME_SCREEN_SIZE=1280x800x24
ENV ROME_NOVNC_PORT=6080
ENV ROME_VNC_PORT=5900
ENV ROME_ENABLE_CHROME=1
ENV ROME_CHROME_NAME=Chrome
ENV ROME_CHROME_CDP_PORT=9222
ENV ROME_CHROME_INTERNAL_CDP_PORT=9223
ENV ROME_CHROME_BIND_ADDRESS=0.0.0.0
ENV ROME_CHROME_STARTUP_WAIT=20
ENV ROME_CHROME_WINDOW_SIZE=1280,800
ENV ROME_CHROME_URL=about:blank
ENV ROME_CHROME_USER_DATA_DIR=/home/rome/.rome/chrome-profile
ENV ROME_CHROME_FULLSCREEN=0
ENV ROME_CHROME_DISABLE_SANDBOX=0
ENV ROME_CHROME_ENABLE_STEALTH=1
ENV ROME_ENABLE_CDP_AUTOMATION=false
ENV ROME_CHROME_TIMEZONE=America/Los_Angeles
ENV ROME_CHROME_LANG=en-US
ENV ROME_CHROME_CLIPBOARD_DEFAULT_SETTING=
EXPOSE 8080 4141 9368 22 5900 6080 9222
# Wait for the one-time setup however long it takes, and stop the container if
# it or a service with a readiness check fails to come up.
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2
ENTRYPOINT ["/init"]