ai-coding-agent-v1 / Dockerfile
Fayzbek's picture
Update Dockerfile
81e7dbe verified
Raw History Blame Contribute Delete
878 Bytes
# 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"]