Fola-AI commited on
Commit
2f28db5
·
1 Parent(s): 519612a

Fix timeout - use pre-built llama-cpp-python wheel

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -16
Dockerfile CHANGED
@@ -4,50 +4,46 @@
4
  # AI-Powered Crop Disease Detection for African Farmers
5
  # =============================================================================
6
 
 
 
 
 
7
  FROM python:3.10-slim
8
 
9
- # Set working directory
10
  WORKDIR /app
11
 
12
- # Set environment variables
13
  ENV PYTHONUNBUFFERED=1
14
- ENV PYTHONDONTWRITEBYTECODE=1
15
  ENV HOST=0.0.0.0
16
  ENV PORT=7860
17
 
18
  # Install system dependencies
19
- # Note: Using libgl1 instead of libgl1-mesa-glx for Debian Trixie compatibility
20
  RUN apt-get update && apt-get install -y --no-install-recommends \
21
  ffmpeg \
22
  libsm6 \
23
  libxext6 \
24
  libgl1 \
25
- build-essential \
26
- cmake \
27
- git \
28
  curl \
29
  && rm -rf /var/lib/apt/lists/*
30
 
31
- # Copy requirements first (for Docker cache optimization)
32
  COPY requirements.txt .
33
 
34
  # Upgrade pip
35
  RUN pip install --no-cache-dir --upgrade pip
36
 
37
- # Install Python dependencies
38
- RUN pip install --no-cache-dir -r requirements.txt
 
39
 
40
- # Install llama-cpp-python for CPU
41
- RUN pip install --no-cache-dir llama-cpp-python
42
 
43
- # Copy all application code
44
  COPY . .
45
 
46
- # Create necessary directories
47
  RUN mkdir -p /app/uploads /app/temp
48
 
49
- # Expose port 7860 (HuggingFace Spaces default)
50
  EXPOSE 7860
51
 
52
- # Run the application
53
  CMD ["python", "main.py"]
 
4
  # AI-Powered Crop Disease Detection for African Farmers
5
  # =============================================================================
6
 
7
+ # =============================================================================
8
+ # FarmEyes - HuggingFace Spaces Dockerfile (Optimized)
9
+ # =============================================================================
10
+
11
  FROM python:3.10-slim
12
 
 
13
  WORKDIR /app
14
 
 
15
  ENV PYTHONUNBUFFERED=1
 
16
  ENV HOST=0.0.0.0
17
  ENV PORT=7860
18
 
19
  # Install system dependencies
 
20
  RUN apt-get update && apt-get install -y --no-install-recommends \
21
  ffmpeg \
22
  libsm6 \
23
  libxext6 \
24
  libgl1 \
 
 
 
25
  curl \
26
  && rm -rf /var/lib/apt/lists/*
27
 
28
+ # Copy requirements
29
  COPY requirements.txt .
30
 
31
  # Upgrade pip
32
  RUN pip install --no-cache-dir --upgrade pip
33
 
34
+ # Install llama-cpp-python from pre-built wheel (FAST - no compilation)
35
+ RUN pip install --no-cache-dir llama-cpp-python \
36
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
37
 
38
+ # Install other dependencies
39
+ RUN pip install --no-cache-dir -r requirements.txt
40
 
41
+ # Copy application code
42
  COPY . .
43
 
44
+ # Create directories
45
  RUN mkdir -p /app/uploads /app/temp
46
 
 
47
  EXPOSE 7860
48
 
 
49
  CMD ["python", "main.py"]