Files
opencode/Dockerfile
T
Hermes Agent 9cf881a8fd
PR Checks / hadolint (pull_request) Successful in 6s
PR Checks / build-test (pull_request) Successful in 1m32s
fix: install better-sqlite3 globally, remove local copy in n2-soul
npm 10+ rejects --allow-scripts in project-scoped (non-global) installs.
Install better-sqlite3@12.11.1 globally with --allow-scripts, then remove
the incompatible v11.10.0 from n2-soul's node_modules so Node.js resolves
the global v12.11.1 instead.
2026-07-13 23:28:16 +00:00

32 lines
1.1 KiB
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 --ignore-scripts n2-soul@9.0.9 && \
npm install -g --no-fund --no-audit --allow-scripts=better-sqlite3 better-sqlite3@12.11.1 && \
rm -rf /usr/local/lib/node_modules/n2-soul/node_modules/better-sqlite3 && \
npm install -g --no-fund --no-audit --allow-scripts=opencode-ai opencode-ai@1.17.18 && \
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"]