Yassine-AO commited on
Commit
ec7bc40
·
verified ·
1 Parent(s): 24dc1c0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -6
Dockerfile CHANGED
@@ -1,11 +1,11 @@
1
- # Start with a specific, stable n8n image
2
- FROM n8nio/n8n:1.64.3
3
 
4
  # Switch to root to install dependencies and set permissions
5
  USER root
6
 
7
- # Install n8n globally to ensure the command is available
8
- RUN npm install -g n8n
9
 
10
  # Create the n8n config folder and set ownership to user ID 1000
11
  RUN mkdir -p /home/user/.n8n && \
@@ -24,5 +24,5 @@ ENV N8N_USER_FOLDER=/home/user/.n8n
24
  # Fix permissions warning
25
  ENV N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
26
 
27
- # Start n8n using the full path to the command
28
- CMD ["/usr/local/bin/n8n", "start"]
 
1
+ # Start with a Node.js base image
2
+ FROM node:20-alpine
3
 
4
  # Switch to root to install dependencies and set permissions
5
  USER root
6
 
7
+ # Install n8n locally
8
+ RUN npm install n8n
9
 
10
  # Create the n8n config folder and set ownership to user ID 1000
11
  RUN mkdir -p /home/user/.n8n && \
 
24
  # Fix permissions warning
25
  ENV N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
26
 
27
+ # Start n8n using node
28
+ CMD ["node", "./node_modules/n8n/bin/n8n", "start"]