Chris4K commited on
Commit
07a8bf8
·
verified ·
1 Parent(s): 9e3e6bf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -16
Dockerfile CHANGED
@@ -1,23 +1,25 @@
1
- # Use the official n8n Docker image
2
- FROM docker.n8n.io/n8nio/n8n:latest
3
 
4
- # Update system and install necessary dependencies
 
 
 
 
 
5
 
 
 
6
 
7
- # Create a user to run n8n (recommended for Hugging Face Spaces)
8
- RUN useradd -m -u 1000 user
 
9
 
10
- # Set environment variables
11
- ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true N8N_HOST=0.0.0.0 N8N_PORT=7860
 
 
 
12
 
13
- # Set user permissions
14
- USER user
15
-
16
- # Set the working directory
17
- WORKDIR $HOME/app
18
-
19
- # Expose the port required by Hugging Face
20
  EXPOSE 7860
21
 
22
- # Start n8n on container launch
23
- CMD ["n8n"]
 
1
+ FROM node:20-slim
 
2
 
3
+ # system deps
4
+ RUN apt-get update && apt-get install -y \
5
+ curl \
6
+ python3 \
7
+ python3-pip \
8
+ && rm -rf /var/lib/apt/lists/*
9
 
10
+ # n8n
11
+ RUN npm install -g n8n
12
 
13
+ # persistent data directory
14
+ ENV N8N_USER_FOLDER=/data/.n8n
15
+ RUN mkdir -p /data/.n8n
16
 
17
+ # required for HF Spaces
18
+ ENV N8N_HOST=0.0.0.0
19
+ ENV N8N_PORT=7860
20
+ ENV N8N_PROTOCOL=http
21
+ ENV WEBHOOK_URL=http://localhost:7860/
22
 
 
 
 
 
 
 
 
23
  EXPOSE 7860
24
 
25
+ CMD ["n8n"]