Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -10
Dockerfile
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
|
|
| 1 |
FROM naskio/n8n-python:2.13.0
|
| 2 |
-
|
| 3 |
LABEL maintainer="Xiaoliang <xiaoliang.zero@gmail.com>"
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
N8N_PROXY_HOPS=1
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
# n8n
|
|
|
|
| 17 |
EXPOSE 5678
|
| 18 |
|
| 19 |
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
|
|
|
|
| 1 |
+
# Use the naskio image which already has Python 3.10+ installed
|
| 2 |
FROM naskio/n8n-python:2.13.0
|
|
|
|
| 3 |
LABEL maintainer="Xiaoliang <xiaoliang.zero@gmail.com>"
|
| 4 |
|
| 5 |
+
# 1. Mandatory for n8n 2.x: Switch to root to fix permissions and env setup
|
| 6 |
+
USER root
|
|
|
|
| 7 |
|
| 8 |
+
# 2. Fix the "Python missing" error in n8n 2.x
|
| 9 |
+
# We tell n8n where the existing Python binary is so it doesn't fail the check
|
| 10 |
+
ENV N8N_PYTHON_BINARY=/usr/bin/python3 \
|
| 11 |
+
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true \
|
| 12 |
+
N8N_PROXY_HOPS=1 \
|
| 13 |
+
NODE_FUNCTION_ALLOW_EXTERNAL="*"
|
| 14 |
|
| 15 |
+
# 3. List the Python libraries you need here
|
| 16 |
+
# n8n will automatically pip install these into its internal runner on startup
|
| 17 |
+
ENV N8N_RUNNERS_PY_PACKAGES="pandas numpy requests beautifulsoup4"
|
| 18 |
+
|
| 19 |
+
# 4. Switch back to the node user (naskio image uses 'node' just like official)
|
| 20 |
+
USER node
|
| 21 |
|
| 22 |
+
# Standard n8n setup
|
| 23 |
+
VOLUME ["/home/node/.n8n"]
|
| 24 |
EXPOSE 5678
|
| 25 |
|
| 26 |
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
|