ProfessorCEO commited on
Commit
59201a2
·
verified ·
1 Parent(s): fafb685

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -7
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM python:3.10-slim
2
 
3
- # 1. Setup User (Required for Spaces)
4
  RUN useradd -m -u 1000 user
5
  USER user
6
  ENV HOME=/home/user \
@@ -8,21 +8,22 @@ ENV HOME=/home/user \
8
 
9
  WORKDIR $HOME/app
10
 
11
- # 2. Install Basic Tools (Keep these just in case)
12
  USER root
13
  RUN apt-get update && apt-get install -y \
 
 
14
  git \
15
  && rm -rf /var/lib/apt/lists/*
16
  USER user
17
 
18
- # 3. SMART INSTALL: Use Pre-Built Wheels!
19
- # We copy requirements but use a special URL to fetch the pre-compiled engine
20
  COPY --chown=user requirements.txt requirements.txt
21
  RUN pip install --no-cache-dir --upgrade pip && \
22
- pip install --no-cache-dir -r requirements.txt --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
23
 
24
- # 4. Copy Application
25
  COPY --chown=user . .
26
 
27
- # 5. Launch
28
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
3
+ # 1. Setup User (Required by Spaces)
4
  RUN useradd -m -u 1000 user
5
  USER user
6
  ENV HOME=/home/user \
 
8
 
9
  WORKDIR $HOME/app
10
 
11
+ # 2. Install Heavy Compilers (The "Factory")
12
  USER root
13
  RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ cmake \
16
  git \
17
  && rm -rf /var/lib/apt/lists/*
18
  USER user
19
 
20
+ # 3. Install Python Dependencies
 
21
  COPY --chown=user requirements.txt requirements.txt
22
  RUN pip install --no-cache-dir --upgrade pip && \
23
+ pip install --no-cache-dir -r requirements.txt
24
 
25
+ # 4. Copy Application Code
26
  COPY --chown=user . .
27
 
28
+ # 5. Launch the Librarian
29
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]