Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +19 -16
Dockerfile
CHANGED
|
@@ -2,28 +2,31 @@ FROM n8nio/runners:latest
|
|
| 2 |
|
| 3 |
USER root
|
| 4 |
|
| 5 |
-
# 1. Install
|
| 6 |
-
RUN
|
| 7 |
-
apt-get install -y nodejs npm python3-venv && \
|
| 8 |
-
rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
# 2. Install Python libraries
|
| 11 |
-
#
|
| 12 |
-
RUN pip install --no-cache
|
| 13 |
|
| 14 |
-
# 3. Install JS libraries
|
| 15 |
-
|
| 16 |
-
|
|
|
|
| 17 |
|
| 18 |
-
# 4. Copy your custom config
|
|
|
|
| 19 |
COPY n8n-task-runners.json /etc/n8n-task-runners.json
|
| 20 |
|
| 21 |
-
# 5. Connection Settings
|
| 22 |
-
#
|
| 23 |
ENV N8N_RUNNERS_AUTH_TOKEN=test \
|
| 24 |
-
N8N_RUNNERS_TASK_BROKER_URI=https://your-user-n8n-main
|
| 25 |
N8N_RUNNERS_CONFIG_FILE=/etc/n8n-task-runners.json
|
| 26 |
|
|
|
|
| 27 |
USER runner
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
USER root
|
| 4 |
|
| 5 |
+
# 1. Install system build tools (Alpine)
|
| 6 |
+
RUN apk add --no-cache make g++ python3-dev
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
# 2. Install Python libraries using the built-in 'uv' (Official n8n way)
|
| 9 |
+
# We target the existing venv in the image
|
| 10 |
+
RUN uv pip install --no-cache pandas numpy requests beautifulsoup4
|
| 11 |
|
| 12 |
+
# 3. Install JS libraries using the built-in 'pnpm'
|
| 13 |
+
# We must use the specific directory defined in the base image
|
| 14 |
+
WORKDIR /opt/runners/task-runner-javascript
|
| 15 |
+
RUN pnpm add lodash axios
|
| 16 |
|
| 17 |
+
# 4. Copy your custom config (Ensure this is in your HF repo)
|
| 18 |
+
WORKDIR /home/runner
|
| 19 |
COPY n8n-task-runners.json /etc/n8n-task-runners.json
|
| 20 |
|
| 21 |
+
# 5. Connection Settings for HF Spaces
|
| 22 |
+
# IMPORTANT: N8N_RUNNERS_TASK_BROKER_URI must point to your Main Space
|
| 23 |
ENV N8N_RUNNERS_AUTH_TOKEN=test \
|
| 24 |
+
N8N_RUNNERS_TASK_BROKER_URI=https://your-user-n8n-main.hf.space \
|
| 25 |
N8N_RUNNERS_CONFIG_FILE=/etc/n8n-task-runners.json
|
| 26 |
|
| 27 |
+
# Switch back to the runner user (UID 1000)
|
| 28 |
USER runner
|
| 29 |
+
|
| 30 |
+
# Use the official launcher to start both JS and Python
|
| 31 |
+
ENTRYPOINT ["tini", "--", "/usr/local/bin/task-runner-launcher"]
|
| 32 |
+
CMD ["javascript", "python"]
|