GTO-Custom-AI commited on
Commit
3cb5dee
·
verified ·
1 Parent(s): 4c7eeb6

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -11
Dockerfile CHANGED
@@ -1,23 +1,24 @@
1
- # Use the official n8n image as the base
2
- FROM n8nio/n8n:latest
3
 
4
- # Hugging Face Spaces requires the app to run on port 7860
5
- ENV N8N_PORT=7860
6
- ENV N8N_PROTOCOL=https
7
 
8
- # Set the path to ensure the n8n binary is found
9
- ENV PATH="/usr/local/bin:${PATH}"
10
 
11
- # POINT N8N TO THE PERSISTENT BUCKET
 
 
12
  ENV N8N_USER_FOLDER=/data/.n8n
13
 
14
- # Set the user to a non-root user for security
15
  USER root
16
  RUN mkdir -p /data/.n8n && chown -R 1000:1000 /data/.n8n
17
  USER 1000
18
 
19
- # Expose the HF port
20
  EXPOSE 7860
21
 
22
- # Simple start command - no shell wrapper
23
  CMD ["n8n", "start"]
 
1
+ # Use Alpine as a clean base to avoid "ghost" permissions from the official image
2
+ FROM alpine:3.19
3
 
4
+ # Install Node.js, npm, and essential tools
5
+ RUN apk add --no-cache nodejs npm curl bash
 
6
 
7
+ # Install n8n globally
8
+ RUN npm install -g n8n
9
 
10
+ # HF Spaces requirements
11
+ ENV N8N_PORT=7860
12
+ ENV N8N_PROTOCOL=https
13
  ENV N8N_USER_FOLDER=/data/.n8n
14
 
15
+ # Create the data directory and force ownership to the HF user (1000)
16
  USER root
17
  RUN mkdir -p /data/.n8n && chown -R 1000:1000 /data/.n8n
18
  USER 1000
19
 
20
+ # Expose port
21
  EXPOSE 7860
22
 
23
+ # Launch n8n using the simple command
24
  CMD ["n8n", "start"]