Update Dockerfile
Browse files- Dockerfile +15 -7
Dockerfile
CHANGED
|
@@ -2,21 +2,29 @@ FROM n8nio/n8n:latest
|
|
| 2 |
|
| 3 |
USER root
|
| 4 |
|
| 5 |
-
# 1. تثبيت
|
| 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 |
-
#
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
#
|
| 15 |
ENV N8N_PORT=7860
|
| 16 |
ENV N8N_PROTOCOL=https
|
| 17 |
|
| 18 |
-
#
|
| 19 |
USER node
|
| 20 |
|
| 21 |
-
#
|
| 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"]
|