FROM n8nio/runners:latest USER root # 1. Install system build tools (Alpine) RUN apk add --no-cache make g++ python3-dev # 2. Install Python libraries using the built-in 'uv' (Official n8n way) # We target the existing venv in the image RUN uv pip install --no-cache pandas numpy requests beautifulsoup4 # 3. Install JS libraries using the built-in 'pnpm' # We must use the specific directory defined in the base image WORKDIR /opt/runners/task-runner-javascript RUN pnpm add lodash axios # 4. Copy your custom config (Ensure this is in your HF repo) WORKDIR /home/runner COPY n8n-task-runners.json /etc/n8n-task-runners.json # 5. Connection Settings for HF Spaces # IMPORTANT: N8N_RUNNERS_TASK_BROKER_URI must point to your Main Space ENV N8N_RUNNERS_AUTH_TOKEN=test \ N8N_RUNNERS_TASK_BROKER_URI=https://your-user-n8n-main.hf.space \ N8N_RUNNERS_CONFIG_FILE=/etc/n8n-task-runners.json # Switch back to the runner user (UID 1000) USER runner # Use the official launcher to start both JS and Python ENTRYPOINT ["tini", "--", "/usr/local/bin/task-runner-launcher"] CMD ["javascript", "python"]