Update Dockerfile
Browse files- Dockerfile +6 -9
Dockerfile
CHANGED
@@ -1,21 +1,18 @@
|
|
1 |
FROM ollama/ollama:0.1.44
|
2 |
|
3 |
-
#
|
4 |
RUN apt-get update && apt-get install -y python3 python3-pip curl
|
5 |
|
6 |
-
#
|
7 |
COPY requirements.txt .
|
8 |
RUN pip3 install -r requirements.txt
|
9 |
|
10 |
-
#
|
11 |
COPY . /app
|
12 |
WORKDIR /app
|
13 |
|
14 |
-
#
|
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 |
-
#
|
18 |
-
|
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 và 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 mã 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"]
|
|
|
|
|
|