# Use Node.js v20 as the base image to match the Synology host environment FROM node:20-slim # Install git and pnpm as root USER root RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* # Switch to the non-privileged node user for all subsequent operations USER node # Set the working directory WORKDIR /app # Clone the Moltbot repository RUN git clone https://github.com/moltbot/moltbot.git . # HACK: Use a brute-force find/sed to patch the Node.js version check in ANY file RUN find . -type f -exec sed -i 's/.*requires Node >=.*/\/\/ Version check disabled by Gemini for Synology compatibility/' {} + # Install pnpm locally as a project dependency RUN npm install pnpm # Install project dependencies using the local pnpm RUN npx pnpm install # Build the project RUN npx pnpm build # Expose the gateway port EXPOSE 18789 # Set the entrypoint to the clawdbot executable ENTRYPOINT ["/app/packages/clawdbot/node_modules/.bin/clawdbot"] # The default command will be provided by docker-compose CMD ["--help"]