Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +28 -7
Dockerfile
CHANGED
|
@@ -1,11 +1,32 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
ARG N8N_VERSION=stable
|
| 2 |
+
FROM docker.n8n.io/n8nio/n8n:$N8N_VERSION
|
| 3 |
+
LABEL maintainer="Xiaoliang <xiaoliang.zero@gmail.com>"
|
| 4 |
|
| 5 |
+
# 1. Switch to root user to install system dependencies
|
| 6 |
+
USER root
|
| 7 |
|
| 8 |
+
# 2. Install Python 3, pip, virtualenv, and build tools
|
| 9 |
+
# (build-base is included in case you need to compile Python packages like numpy/pandas)
|
| 10 |
+
RUN apk add --no-cache python3 py3-pip py3-virtualenv build-base
|
| 11 |
|
| 12 |
+
# 3. Switch back to the default non-root user (node) for security
|
| 13 |
+
USER node
|
| 14 |
|
| 15 |
+
# 4. Set Environment Variables
|
| 16 |
+
# Removed N8N_RUNNERS_ENABLED (Deprecated)
|
| 17 |
+
# Added NODE_FUNCTION_ALLOW_EXTERNAL to permit importing third-party libraries in Code nodes
|
| 18 |
+
ENV N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true \
|
| 19 |
+
N8N_PROXY_HOPS=1 \
|
| 20 |
+
NODE_FUNCTION_ALLOW_EXTERNAL="*"
|
| 21 |
+
|
| 22 |
+
# (Optional) Tell n8n which Python libraries to auto-install into its internal virtual environment
|
| 23 |
+
# ENV N8N_RUNNERS_PY_PACKAGES="requests pandas beautifulsoup4"
|
| 24 |
+
|
| 25 |
+
# https://huggingface.co/docs/hub/spaces-sdks-docker#permissions
|
| 26 |
+
# The container runs with user ID 1000.
|
| 27 |
+
VOLUME ["$HOME/.n8n"]
|
| 28 |
+
|
| 29 |
+
# n8n default port
|
| 30 |
+
EXPOSE 5678
|
| 31 |
+
|
| 32 |
+
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
|