feat(docker): add init script support via /openclaw-init.d/

Adds an ENTRYPOINT script that runs user-provided init scripts from
/openclaw-init.d/ before starting the gateway. This is the standard
Docker pattern (used by nginx, postgres, etc.) for customizing container
startup without overriding the entire entrypoint.

Usage:
  docker run -v ./my-init-scripts:/openclaw-init.d:ro openclaw

Scripts must be executable. Non-executable files are skipped with a
warning. Scripts run in alphabetical order with output prefixed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
JayMishra-github
2026-02-16 10:20:42 -08:00
committed by Peter Steinberger
parent 717caa97fb
commit 53af9f7437
2 changed files with 34 additions and 0 deletions

View File

@@ -43,6 +43,11 @@ RUN chown -R node:node /app
# This reduces the attack surface by preventing container escape via root privileges
USER node
# Support custom init scripts mounted at /openclaw-init.d/
# Scripts must be executable. They run before the gateway starts.
# Example: docker run -v ./my-scripts:/openclaw-init.d:ro openclaw
ENTRYPOINT ["/app/scripts/docker-entrypoint.sh"]
# Start gateway server with default config.
# Binds to loopback (127.0.0.1) by default for security.
#