fix(docker): expose moltbot CLI via root entrypoint

This commit is contained in:
neeraj kumar reddy kamireddy 2026-01-29 21:40:39 +05:30 committed by saianilsingi
parent c9fe062824
commit 46e1a7db3d

View File

@ -35,6 +35,13 @@ ENV NODE_ENV=production
# Security hardening: Run as non-root user
# The node:22-bookworm image includes a 'node' user (uid 1000)
# This reduces the attack surface by preventing container escape via root privileges
# Expose moltbot CLI globally (use root entrypoint, pnpm-safe)
RUN printf '#!/bin/sh\nexec node /app/moltbot.mjs "$@"\n' \
> /usr/local/bin/moltbot \
&& chmod +x /usr/local/bin/moltbot
USER node
CMD ["node", "dist/index.js"]