chang ollama docker
Browse files- Dockerfile +11 -14
Dockerfile
CHANGED
|
@@ -1,25 +1,22 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
# Install curl and other dependencies
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
-
|
|
|
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
|
| 11 |
-
RUN curl -fsSL https://ollama.com/install.sh | sh
|
| 12 |
|
| 13 |
COPY ./requirements.txt /app/requirements.txt
|
| 14 |
COPY ./app.py /app/app.py
|
| 15 |
COPY ./templates /app/templates
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
EXPOSE 7860
|
| 22 |
-
|
| 23 |
-
#CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 24 |
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ollama/ollama
|
| 2 |
|
| 3 |
+
# Install Python and dependencies
|
|
|
|
|
|
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
+
python3 \
|
| 6 |
+
python3-pip \
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
+
WORKDIR /app
|
|
|
|
| 10 |
|
| 11 |
COPY ./requirements.txt /app/requirements.txt
|
| 12 |
COPY ./app.py /app/app.py
|
| 13 |
COPY ./templates /app/templates
|
| 14 |
|
| 15 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
+
EXPOSE 7860 11434
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
# Run Ollama and FastAPI app
|
| 20 |
+
CMD ollama serve & sleep 5 && \
|
| 21 |
+
ollama pull gemma:2b && \
|
| 22 |
+
python3 -m uvicorn app:app --host 0.0.0.0 --port 7860
|