danghungithp commited on
Commit
a59c011
·
verified ·
1 Parent(s): 3154263

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -9
Dockerfile CHANGED
@@ -1,21 +1,18 @@
1
  FROM ollama/ollama:0.1.44
2
 
3
- # Install Python, pip, and curl (for health check)
4
  RUN apt-get update && apt-get install -y python3 python3-pip curl
5
 
6
- # Copy and install Python dependencies
7
  COPY requirements.txt .
8
  RUN pip3 install -r requirements.txt
9
 
10
- # Copy the application code
11
  COPY . /app
12
  WORKDIR /app
13
 
14
- # Create and configure startup script
15
  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
16
 
17
- # Expose port for Hugging Face Spaces
18
- EXPOSE 7860
19
-
20
- # Set the startup script as the entry point
21
- CMD ["./start.sh"]
 
1
  FROM ollama/ollama:0.1.44
2
 
3
+ # Cài đặt các công cụ cần thiết: Python, pip, curl
4
  RUN apt-get update && apt-get install -y python3 python3-pip curl
5
 
6
+ # Sao chép cài đặt các dependencies của Python
7
  COPY requirements.txt .
8
  RUN pip3 install -r requirements.txt
9
 
10
+ # Sao chép nguồn ứng dụng
11
  COPY . /app
12
  WORKDIR /app
13
 
14
+ # Tạo shell script để khởi động dịch vụ
15
  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
16
 
17
+ # Ghi đè entrypoint để chạy script
18
+ ENTRYPOINT ["/bin/bash", "-c", "./start.sh"]