From 8c07e30f17318deb9ac3138f2e3afa1cd9f958f3 Mon Sep 17 00:00:00 2001 From: VfBfoerst <64251549+VfBfoerst@users.noreply.github.com> Date: Tue, 30 Jan 2024 12:25:38 +0100 Subject: [PATCH 1/3] Create Dockerfile --- Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..47e621c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM python:3.11 + +# install necessary tools into the base image and download git repository +RUN apt update && apt install -y git apache2 && git clone https://github.com/ParisNeo/ollama_proxy_server.git + +# change working directory to cloned git repository +WORKDIR ollama_proxy_server + +# install all requirements +RUN pip3 install -e . + +# copy config.ini and authorized_users.txt into project working directory +COPY config.ini . +COPY authorized_users.txt . + +# start the proxy server as entrypoint +ENTRYPOINT ["ollama_proxy_server"] + +# set command line parameters +CMD ["--config", "./config.ini", "--users_list", "./authorized_users.txt", "--port", "8080"] From 73b2265bf034b255468458db0a94596fac151595 Mon Sep 17 00:00:00 2001 From: VfBfoerst <64251549+VfBfoerst@users.noreply.github.com> Date: Tue, 30 Jan 2024 12:35:14 +0100 Subject: [PATCH 2/3] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 4c4f7f9..6893c8f 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,18 @@ Make sure you have Python (>=3.8) and Apache installed on your system before pro 1. Clone or download the `ollama_proxy_server` repository from GitHub: https://github.com/ParisNeo/ollama_proxy_server 2. Navigate to the cloned directory in the terminal and run `pip install -e .` +## Installation using Dockerfile +1. Clone this repository as described above. +2. Build your Container-Image with the Dockerfile provided by this repository + +### Podman +`cd ollama_proxy_server` +`podman build -t ollama_proxy_server:latest .` + +### Docker +`cd ollama_proxy_server` +`docker build -t ollama_proxy_server:latest .` + ## Configuration ### Servers configuration (config.ini) From 9d748dce01c254bdf75eb32e0d0cb22cc4e2dc17 Mon Sep 17 00:00:00 2001 From: VfBfoerst <64251549+VfBfoerst@users.noreply.github.com> Date: Tue, 30 Jan 2024 18:27:22 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6893c8f..5a300cb 100644 --- a/README.md +++ b/README.md @@ -69,3 +69,7 @@ For example: ```bash curl -X POST -H "Authorization: Bearer user1:key1" http://localhost:8080/api/generate --data '{"data": "Hello, World!"}' ``` +### Starting the server using the created Container-Image +To start the proxy in background with the above created image, you can use either +1) docker: `docker run -d --name ollama-proxy-server -p 8080:8080 ollama_proxy_server:latest` +2) podman: `podman run -d --name ollama-proxy-server -p 8080:8080 ollama_proxy_server:latest`