danghungithp's picture
Update Dockerfile
a59c011 verified
raw
history blame
640 Bytes
FROM ollama/ollama:0.1.44
# Cài đặt các công cụ cần thiết: Python, pip, curl
RUN apt-get update && apt-get install -y python3 python3-pip curl
# Sao chép và cài đặt các dependencies của Python
COPY requirements.txt .
RUN pip3 install -r requirements.txt
# Sao chép mã nguồn ứng dụng
COPY . /app
WORKDIR /app
# Tạo shell script để khởi động dịch vụ
RUN echo '#!/bin/bash\nollama serve &\nuntil curl -s http://localhost:11434 > /dev/null; do\n sleep 1\ndone\npython3 app.py' > start.sh && chmod +x start.sh
# Ghi đè entrypoint để chạy script
ENTRYPOINT ["/bin/bash", "-c", "./start.sh"]