1yahoo commited on
Commit
46570d8
·
verified ·
1 Parent(s): a24c18a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -26
Dockerfile CHANGED
@@ -1,32 +1,8 @@
1
- # المرحلة 1: بناء واجهة Next.js (Chatbot UI)
2
- FROM node:18-alpine AS frontend-builder
3
- RUN apk add --no-cache git
4
- RUN git clone https://github.com/mckaywrigley/chatbot-ui.git /app/frontend
5
- WORKDIR /app/frontend
6
- RUN npm install
7
- # ضبط إعدادات الواجهة الأساسية
8
- ENV NEXT_PUBLIC_DEFAULT_MODEL="huihui-ai/Qwen2.5-72B-Instruct-abliterated"
9
- RUN npm run build
10
-
11
- # المرحلة 2: تشغيل النظام الهجين (Python + Node)
12
  FROM python:3.11-slim
13
  WORKDIR /app
14
-
15
- # تثبيت متطلبات البايثون
16
  COPY requirements.txt .
17
  RUN pip install --no-cache-dir -r requirements.txt
18
-
19
- # تثبيت Node.js لتشغيل واجهة Next.js
20
- RUN apt-get update && apt-get install -y curl && \
21
- curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
22
- apt-get install -y nodejs && rm -rf /var/lib/apt/lists/*
23
-
24
- # نسخ الكود والواجهة المبنية من المرحلة الأولى
25
  COPY . .
26
- COPY --from=frontend-builder /app/frontend /app/frontend
27
-
28
- # المنفذ الرسمي لـ Hugging Face Spaces
29
  EXPOSE 7860
30
-
31
- # تشغيل الخلفية (FastAPI) والواجهة (Next.js) معاً
32
- CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port 8000 & cd frontend && npm start -- -p 7860"]
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM python:3.11-slim
2
  WORKDIR /app
 
 
3
  COPY requirements.txt .
4
  RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
 
5
  COPY . .
6
+ # تأكد من أن المنفذ هو 7860 وهو المنفذ الرسمي لهجينج فيس
 
 
7
  EXPOSE 7860
8
+ CMD ["python", "app.py"]