Yking23 commited on
Commit
8cc9672
·
verified ·
1 Parent(s): d490612

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -7
Dockerfile CHANGED
@@ -2,21 +2,29 @@ FROM n8nio/n8n:latest
2
 
3
  USER root
4
 
5
- # 1. تثبيت أداة Cloudflare
6
  RUN apk add --no-cache wget ca-certificates
 
 
7
  RUN wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -O /usr/local/bin/cloudflared && \
8
  chmod +x /usr/local/bin/cloudflared
9
 
10
- # 2. إعداد ملف التشغيل (تأكد أن اسمه start.sh في الـ Space)
11
- COPY start.sh /start.sh
12
- RUN chmod +x /start.sh && chown node:node /start.sh
 
 
 
 
 
 
13
 
14
- # 3. إعدادات المنفذ والمتغيرات
15
  ENV N8N_PORT=7860
16
  ENV N8N_PROTOCOL=https
17
 
18
- # 4. العودة للمستخدم node (إجباري في الصور الحديثة لـ n8n)
19
  USER node
20
 
21
- # 5. التشغيل باستخدام التنسيق ده (لضمان التقاط الـ Secrets)
22
  ENTRYPOINT ["/bin/sh", "/start.sh"]
 
2
 
3
  USER root
4
 
5
+ # 1. تثبيت الإضافات المطلوبة
6
  RUN apk add --no-cache wget ca-certificates
7
+
8
+ # 2. تحميل وتثبيت Cloudflared
9
  RUN wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -O /usr/local/bin/cloudflared && \
10
  chmod +x /usr/local/bin/cloudflared
11
 
12
+ # 3. كتابة سكريبت التشغيل برمجياً من داخل لينكس (للقضاء على مشاكل الويندوز)
13
+ RUN echo '#!/bin/sh' > /start.sh && \
14
+ echo 'if [ -n "$CLOUDFLARE_TUNNEL_TOKEN" ]; then' >> /start.sh && \
15
+ echo ' echo "Starting Cloudflare Tunnel..."' >> /start.sh && \
16
+ echo ' /usr/local/bin/cloudflared tunnel --no-autoupdate run --token "$CLOUDFLARE_TUNNEL_TOKEN" &' >> /start.sh && \
17
+ echo 'fi' >> /start.sh && \
18
+ echo 'echo "Starting n8n..."' >> /start.sh && \
19
+ echo 'exec /docker-entrypoint.sh n8n' >> /start.sh && \
20
+ chmod +x /start.sh && chown node:node /start.sh
21
 
22
+ # 4. إعدادات البورت الأساسية لـ Hugging Face
23
  ENV N8N_PORT=7860
24
  ENV N8N_PROTOCOL=https
25
 
26
+ # 5. العودة للمستخدم الافتراضي لضمان الأمان
27
  USER node
28
 
29
+ # 6. تشغيل النظام
30
  ENTRYPOINT ["/bin/sh", "/start.sh"]