Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +21 -17
Dockerfile
CHANGED
|
@@ -1,26 +1,30 @@
|
|
| 1 |
-
# Use the naskio image
|
| 2 |
FROM naskio/n8n-python:2.13.0
|
| 3 |
LABEL maintainer="Xiaoliang <xiaoliang.zero@gmail.com>"
|
| 4 |
|
| 5 |
-
# 1.
|
| 6 |
-
USER root
|
|
|
|
| 7 |
|
| 8 |
-
# 2.
|
| 9 |
-
#
|
|
|
|
|
|
|
|
|
|
| 10 |
ENV N8N_PYTHON_BINARY=/usr/bin/python3 \
|
| 11 |
-
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=
|
|
|
|
| 12 |
N8N_PROXY_HOPS=1 \
|
| 13 |
-
NODE_FUNCTION_ALLOW_EXTERNAL="*"
|
| 14 |
-
|
| 15 |
-
|
| 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 |
-
#
|
| 20 |
-
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
| 24 |
-
EXPOSE 5678
|
| 25 |
|
| 26 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the naskio image for built-in Python
|
| 2 |
FROM naskio/n8n-python:2.13.0
|
| 3 |
LABEL maintainer="Xiaoliang <xiaoliang.zero@gmail.com>"
|
| 4 |
|
| 5 |
+
# 1. We must stay as USER node for HF Spaces compatibility
|
| 6 |
+
# We do NOT use 'USER root' to avoid 'su-exec' or 'chown' errors at runtime
|
| 7 |
+
USER node
|
| 8 |
|
| 9 |
+
# 2. Environment Configuration for HF Spaces
|
| 10 |
+
# - N8N_PYTHON_BINARY: Points to the Python path
|
| 11 |
+
# - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS: Set to false to stop n8n from trying to chown files
|
| 12 |
+
# - N8N_PORT: HF Spaces listens on 7860
|
| 13 |
+
# - N8N_RUNNERS_PY_PACKAGES: Auto-installs your libraries
|
| 14 |
ENV N8N_PYTHON_BINARY=/usr/bin/python3 \
|
| 15 |
+
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false \
|
| 16 |
+
N8N_PORT=7860 \
|
| 17 |
N8N_PROXY_HOPS=1 \
|
| 18 |
+
NODE_FUNCTION_ALLOW_EXTERNAL="*" \
|
| 19 |
+
N8N_RUNNERS_PY_PACKAGES="pandas numpy requests" \
|
| 20 |
+
HOME=/home/node
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
# 3. Set the working directory to the user's home
|
| 23 |
+
WORKDIR /home/node
|
| 24 |
|
| 25 |
+
# 4. Expose the HF Space port
|
| 26 |
+
EXPOSE 7860
|
|
|
|
| 27 |
|
| 28 |
+
# 5. Overwrite the entrypoint
|
| 29 |
+
# We call n8n directly instead of using the default script to avoid 'su-exec' permission errors
|
| 30 |
+
ENTRYPOINT ["tini", "--", "n8n"]
|