Soumik Bose commited on
Commit
8c5cbbd
·
1 Parent(s): 5aaa926
Files changed (1) hide show
  1. Dockerfile +5 -10
Dockerfile CHANGED
@@ -8,10 +8,11 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
8
 
9
  WORKDIR /app
10
 
11
- # 1. Install only runtime dependencies (curl for healthchecks)
12
- # REMOVED: build-essential, cmake, git (Not needed anymore!)
13
  RUN apt-get update && apt-get install -y \
14
  curl \
 
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
  # 2. Create user and directories
@@ -24,23 +25,17 @@ RUN pip install --no-cache-dir --upgrade pip
24
  USER user
25
 
26
  # 4. Install the Local Wheel
27
- # This copies your local 'wheels' folder into the Docker image
28
  COPY --chown=user:user ./wheels /app/wheels
29
-
30
- # This installs the pre-built wheel.
31
- # We REMOVED CMAKE_ARGS because the wheel is already compiled!
32
  RUN pip install --no-cache-dir /app/wheels/llama_cpp_python-*.whl
33
 
34
- # 5. Install other dependencies (FastAPI, uvicorn, etc.)
35
  COPY --chown=user:user requirements.txt .
36
  RUN pip install --no-cache-dir -r requirements.txt
37
 
38
  # 6. Copy ALL Application Code
39
- # Using "COPY . ." is safer than listing files manually because
40
- # it ensures config.py, services/, routers/, and utils/ are all included.
41
  COPY --chown=user:user . .
42
 
43
  EXPOSE 7860
44
 
45
- # 7. Start the app (With keep-alive loop for Hugging Face Spaces)
46
  CMD ["bash", "-c", "while true; do curl -s http://localhost:7860/health > /dev/null || true; sleep 300; done & python -m uvicorn main:app --host 0.0.0.0 --port 7860"]
 
8
 
9
  WORKDIR /app
10
 
11
+ # 1. Install runtime dependencies
12
+ # Added 'libgomp1' here to fix the "libgomp.so.1" error
13
  RUN apt-get update && apt-get install -y \
14
  curl \
15
+ libgomp1 \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
  # 2. Create user and directories
 
25
  USER user
26
 
27
  # 4. Install the Local Wheel
 
28
  COPY --chown=user:user ./wheels /app/wheels
 
 
 
29
  RUN pip install --no-cache-dir /app/wheels/llama_cpp_python-*.whl
30
 
31
+ # 5. Install other dependencies
32
  COPY --chown=user:user requirements.txt .
33
  RUN pip install --no-cache-dir -r requirements.txt
34
 
35
  # 6. Copy ALL Application Code
 
 
36
  COPY --chown=user:user . .
37
 
38
  EXPOSE 7860
39
 
40
+ # 7. Start the app
41
  CMD ["bash", "-c", "while true; do curl -s http://localhost:7860/health > /dev/null || true; sleep 300; done & python -m uvicorn main:app --host 0.0.0.0 --port 7860"]