Create Dockerfile
Browse files- Dockerfile +37 -0
Dockerfile
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ============================================
|
| 2 |
+
# G4F Docker Image
|
| 3 |
+
# ============================================
|
| 4 |
+
FROM python:3.11-slim
|
| 5 |
+
|
| 6 |
+
# معلومات المطور
|
| 7 |
+
LABEL maintainer="YourName"
|
| 8 |
+
LABEL description="G4F API Server - Free AI Chat"
|
| 9 |
+
|
| 10 |
+
# إعداد بيئة العمل
|
| 11 |
+
WORKDIR /app
|
| 12 |
+
|
| 13 |
+
# تحديث النظام وتثبيت المتطلبات
|
| 14 |
+
RUN apt-get update && \
|
| 15 |
+
apt-get install -y --no-install-recommends curl && \
|
| 16 |
+
apt-get clean && \
|
| 17 |
+
rm -rf /var/lib/apt/lists/*
|
| 18 |
+
|
| 19 |
+
# نسخ المتطلبات أولاً (لتسريع البناء)
|
| 20 |
+
COPY requirements.txt .
|
| 21 |
+
|
| 22 |
+
# تثبيت المكتبات
|
| 23 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
| 24 |
+
pip install --no-cache-dir -r requirements.txt
|
| 25 |
+
|
| 26 |
+
# نسخ الكود
|
| 27 |
+
COPY . .
|
| 28 |
+
|
| 29 |
+
# المنفذ
|
| 30 |
+
EXPOSE 8080
|
| 31 |
+
|
| 32 |
+
# فحص الصحة
|
| 33 |
+
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
|
| 34 |
+
CMD curl -f http://localhost:8080/health || exit 1
|
| 35 |
+
|
| 36 |
+
# تشغيل التطبيق
|
| 37 |
+
CMD ["python", "app.py"]
|