forked from Luxadevi/Ollama-Companion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Buildfile docker container for ollama-companion standalone
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# First Stage - Building the Go application | ||
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04 as builder | ||
|
||
ARG TARGETARCH | ||
ARG GOFLAGS="'-ldflags=-w -s'" | ||
|
||
WORKDIR /go/src/github.com/jmorganca/ollama | ||
|
||
RUN apt-get update && apt-get install -y git build-essential cmake | ||
|
||
|
||
RUN git clone https://github.com/ggerganov/llama.cpp.git && \ | ||
mkdir llama.cpp/build && \ | ||
cd llama.cpp/build && \ | ||
cmake .. && \ | ||
cmake --build . --config Release | ||
|
||
# Second Stage - Setting up Python environment and runtime | ||
FROM ubuntu:22.04 | ||
|
||
# Install Python 3.11, venv, and other necessary packages | ||
RUN apt-get update && apt-get install -y curl aria2 ca-certificates python3.11 python3.11-venv git | ||
|
||
# Clone the Python application repository | ||
WORKDIR /ollama-companion | ||
RUN git clone https://github.com/luxadevi/ollama-companion.git . | ||
RUN git clone https://github.com/ggerganov/llama.cpp.git | ||
# Set up Python virtual environment and install dependencies | ||
RUN python3.11 -m venv venv | ||
RUN /bin/bash -c "source venv/bin/activate && venv/bin/pip install -r requirements.txt" | ||
|
||
|
||
# Copy the run.sh script and make it executable | ||
COPY run.sh /run.sh | ||
RUN chmod +x /run.sh | ||
|
||
COPY --from=builder /go/src/github.com/jmorganca/ollama/llama.cpp/build/bin /ollama-companion/llama.cpp | ||
|
||
|
||
EXPOSE 8501 | ||
ENV OLLAMA_HOST 0.0.0.0 | ||
|
||
## Set the entry point to run.sh | ||
ENTRYPOINT ["/run.sh"] |