viskav commited on
Commit
00e7f55
·
verified ·
1 Parent(s): a68d92d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -18
Dockerfile CHANGED
@@ -1,28 +1,31 @@
1
- FROM python:3.11-slim
2
 
3
- RUN apt-get update && apt-get install -y --no-install-recommends \
 
 
 
4
  build-essential \
5
- cmake \
6
- git \
7
- wget \
8
- libgomp1 \
9
- libopenblas-dev \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- WORKDIR /code
 
13
 
14
- COPY requirements.txt /code/requirements.txt
15
- RUN pip install --no-cache-dir --upgrade pip \
16
- && pip install --no-cache-dir -r /code/requirements.txt
17
 
18
- COPY app.py /code/app.py
 
19
 
20
- # Copy model (NO folder needed)
21
- COPY Phi-3.1-mini-4k-instruct-IQ2_M.gguf /code/
22
-
23
- ENV MODEL_PATH=/code/Phi-3.1-mini-4k-instruct-IQ2_M.gguf
 
 
24
 
 
25
  EXPOSE 7860
26
 
27
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
28
-
 
1
+ FROM python:3.10-slim
2
 
3
+ WORKDIR /code
4
+
5
+ # Install minimal system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
  build-essential \
8
+ curl \
 
 
 
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Copy requirements first for better caching
12
+ COPY requirements.txt .
13
 
14
+ # Install Python dependencies
15
+ RUN pip install --no-cache-dir -r requirements.txt
 
16
 
17
+ # Copy application
18
+ COPY app.py .
19
 
20
+ # Download model (will happen automatically at runtime)
21
+ # Or you can download it here if you want:
22
+ # RUN pip install huggingface-hub && \
23
+ # python -c "from huggingface_hub import hf_hub_download; \
24
+ # hf_hub_download(repo_id='bartowski/Phi-3.1-mini-4k-instruct-GGUF', \
25
+ # filename='Phi-3.1-mini-4k-instruct-IQ2_M.gguf', local_dir='/code')"
26
 
27
+ # Expose port
28
  EXPOSE 7860
29
 
30
+ # Run the app
31
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]