GTO-Custom-AI commited on
Commit
59c3ae4
·
verified ·
1 Parent(s): 933cfdd

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -11
Dockerfile CHANGED
@@ -1,11 +1,8 @@
1
- # Use Alpine as the base
2
- FROM alpine:3.19
3
 
4
- # 1. Install all dependencies and build tools in one layer
5
- # We include python3, make, and g++ because n8n's native modules need them to compile
6
  RUN apk add --no-cache \
7
- nodejs=~20 \
8
- npm \
9
  python3 \
10
  make \
11
  g++ \
@@ -18,20 +15,20 @@ RUN apk add --no-cache \
18
  ca-certificates \
19
  tzdata
20
 
21
- # 2. Install n8n globally and clean up the npm cache to keep image size down
22
  RUN npm install -g n8n@latest && npm cache clean --force
23
 
24
- # 3. HF Spaces requirements
25
  ENV N8N_PORT=7860 \
26
  N8N_PROTOCOL=https \
27
  N8N_USER_FOLDER=/data/.n8n \
28
  NODE_ENV=production
29
 
30
- # 4. Setup permissions for the persistent bucket
31
  USER root
32
  RUN mkdir -p /data/.n8n && chown -R 1000:1000 /data/.n8n
33
 
34
- # 5. Create the n8n user (uid 1000)
35
  RUN addgroup -g 1000 n8n && \
36
  adduser -u 1000 -G n8n -s /bin/bash -D n8n
37
 
@@ -44,6 +41,6 @@ EXPOSE 7860
44
  COPY --chown=1000:1000 start.sh /start.sh
45
  RUN chmod +x /start.sh
46
 
47
- # Use tini as PID 1 to handle signals and zombies correctly
48
  ENTRYPOINT ["/sbin/tini", "--"]
49
  CMD ["/start.sh"]
 
1
+ # Use Node 22 Alpine as the base to satisfy n8n's engine requirements (Node >= 22.16)
2
+ FROM node:22-alpine
3
 
4
+ # Install essential build tools for native modules (node-gyp, isolated-vm)
 
5
  RUN apk add --no-cache \
 
 
6
  python3 \
7
  make \
8
  g++ \
 
15
  ca-certificates \
16
  tzdata
17
 
18
+ # Install n8n globally
19
  RUN npm install -g n8n@latest && npm cache clean --force
20
 
21
+ # HF Spaces requirements
22
  ENV N8N_PORT=7860 \
23
  N8N_PROTOCOL=https \
24
  N8N_USER_FOLDER=/data/.n8n \
25
  NODE_ENV=production
26
 
27
+ # Setup permissions for the persistent bucket
28
  USER root
29
  RUN mkdir -p /data/.n8n && chown -R 1000:1000 /data/.n8n
30
 
31
+ # Create the n8n user (uid 1000)
32
  RUN addgroup -g 1000 n8n && \
33
  adduser -u 1000 -G n8n -s /bin/bash -D n8n
34
 
 
41
  COPY --chown=1000:1000 start.sh /start.sh
42
  RUN chmod +x /start.sh
43
 
44
+ # Use tini as PID 1 to handle signals correctly
45
  ENTRYPOINT ["/sbin/tini", "--"]
46
  CMD ["/start.sh"]