Subham9126 commited on
Commit
1e588d4
·
verified ·
1 Parent(s): 565e8b1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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
- ENV N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true \
6
- N8N_RUNNERS_ENABLED=true \
7
- N8N_PROXY_HOPS=1
8
 
9
- # https://huggingface.co/docs/hub/spaces-sdks-docker#permissions
10
- # The container runs with user ID 1000.
11
- # node docker image already has a user named node with ID 1000.
12
- USER node
 
 
13
 
14
- VOLUME ["$HOME/.n8n"]
 
 
 
 
 
15
 
16
- # n8n default port
 
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"]