Files
opencode/Dockerfile
T
Hermes Agent 6ccd634cd9
PR Checks / hadolint (pull_request) Failing after 6s
PR Checks / build-test (pull_request) Failing after 2m39s
fix: upgrade better-sqlite3 to v12 for Node 26 compatibility
n2-soul@9.0.9 depends on better-sqlite3@^11.10.0 which does not
support Node.js 26. The V8 API changed (GetPrototype removed in
favor of GetPrototypeV2), causing native compilation to fail.

Upgrade to better-sqlite3@12.11.1 which supports Node 26 and has
prebuilt binaries.
2026-07-13 23:18:25 +00:00

29 lines
989 B
Docker

FROM node:26-trixie
ENV NPM_CONFIG_UPDATE_NOTIFIER=false \
NPM_CONFIG_LOGLEVEL=warn \
NODE_ENV=production
RUN apt-get update && \
apt-get upgrade -y --no-install-recommends ca-certificates && \
rm -rf /var/lib/apt/lists/* && \
set -eux; \
userdel -r node; \
groupadd -g 1000 opencode; \
useradd -m -u 1000 -g 1000 -s /usr/bin/bash opencode; \
npm update -g --no-fund --no-audit && \
npm install -g --no-fund --no-audit --allow-scripts=opencode-ai,better-sqlite3 opencode-ai@1.17.18 n2-soul@9.0.9 && \
cd /usr/local/lib/node_modules/n2-soul && npm install --no-fund --no-audit --no-save better-sqlite3@12.11.1 && cd / && \
npm cache clean --force && \
chown -R 1000:1000 /usr/local/lib/node_modules/n2-soul/
COPY --chmod=755 opencode-attach /usr/local/bin/opencode-attach
COPY --from=registry.k8s.io/kubectl:v1.36.2 /bin/kubectl /usr/local/bin/kubectl
USER opencode
WORKDIR /home/opencode
RUN opencode --version
ENTRYPOINT ["opencode"]