File size: 878 Bytes
b8218e0
53bbd75
 
b8218e0
30bb5ad
 
d70b5e0
7e8685f
30bb5ad
53bbd75
b8218e0
53bbd75
 
b8218e0
53bbd75
 
b8218e0
 
 
85d978c
b8218e0
 
53bbd75
81e7dbe
85d978c
30bb5ad
b8218e0
6ff2fc9
 
b8218e0
81e7dbe
85d978c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Yengil Python bazaviy tasviridan foydalanamiz
FROM python:3.11-slim

# Tizim uchun zarur bo'lgan paketlarni o'rnatamiz
RUN apt-get update && apt-get install -y \
    curl \
    zstd \
    procps \
    && rm -rf /var/lib/apt/lists/*

# Ollama'ni o'rnatish
RUN curl -fsSL https://ollama.com/install.sh | sh

# Ishchi katalog
WORKDIR /app

# Requirements faylini ko'chirib, o'rnatamiz
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Barcha kod fayllarini ko'chiramiz
COPY . .

# Modelni build jarayonida yuklab olish (serverni vaqtincha ishga tushirib)
RUN ollama serve & sleep 20 && ollama pull qwen2.5:3b && pkill ollama

# Hugging Face uchun kerakli port
EXPOSE 7860

# FastAPI ni ishga tushirish
# Ollama'ni fonda ishga tushirib, FastAPI'ni kutib turadi
CMD ["sh", "-c", "ollama serve & sleep 10 && uvicorn main:app --host 0.0.0.0 --port 7860"]