viskav commited on
Commit
5342639
·
verified ·
1 Parent(s): 8391e3e

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Avoid Python buffering issues
4
+ ENV PYTHONUNBUFFERED=1
5
+ ENV HF_HUB_ENABLE_HF_TRANSFER=1
6
+
7
+ # System dependencies for llama.cpp
8
+ RUN apt-get update && apt-get install -y \
9
+ build-essential \
10
+ cmake \
11
+ git \
12
+ curl \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Set working directory
16
+ WORKDIR /code
17
+
18
+ # Copy requirements first (better caching)
19
+ COPY requirements.txt /code/
20
+
21
+ # Install Python dependencies
22
+ RUN pip install --no-cache-dir --upgrade pip \
23
+ && pip install --no-cache-dir -r requirements.txt
24
+
25
+ # Copy app code
26
+ COPY app.py /code/app.py
27
+
28
+ # Expose HF default port
29
+ EXPOSE 7860
30
+
31
+ # IMPORTANT: Start FastAPI server
32
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]