From dd85ea5e2908b79799e41c78df95f653b330c2e5 Mon Sep 17 00:00:00 2001 From: LD-Reborn Date: Sat, 12 Jul 2025 21:48:40 +0200 Subject: [PATCH] Added Docker to server --- README.md | 2 +- src/Server/Dockerfile | 12 +++++++++ src/Server/appsettings.Docker.json | 41 ++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 src/Server/Dockerfile create mode 100644 src/Server/appsettings.Docker.json diff --git a/README.md b/README.md index ab1be9c..6c73a37 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ This repository comes with a # How to set up / use ## Server +(Docker now available! See [Docker installation](docs/Server.md#docker-installation)) 1. Install [ollama](https://ollama.com/download) 2. Pull a few models using ollama (e.g. `paraphrase-multilingual`, `bge-m3`, `mxbai-embed-large`, `nomic-embed-text`) 3. [Install the depencencies](docs/Server.md#installing-the-dependencies) @@ -80,7 +81,6 @@ This repository comes with a - Reranker/Crossencoder/RAG (or anything else beyond initial retrieval) support - Remove the `id` collumns from the database tables where the table is actually identified (and should be unique by) the name, which should become the new primary key. - Improve performance & latency (Create ready-to-go processes where each contain an n'th share of the entity cache, ready to perform a query. Prepare it after creating the entity cache.) -- Make the API server (~~and indexer, once it is done~~ Indexer: done, Server: todo) a docker container - Implement dynamic invocation based database migrations # Future features diff --git a/src/Server/Dockerfile b/src/Server/Dockerfile new file mode 100644 index 0000000..fe1699f --- /dev/null +++ b/src/Server/Dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +WORKDIR /build +COPY . . +RUN dotnet restore ./Server.csproj +RUN dotnet publish ./Server.csproj -c Release -o /output + +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final +WORKDIR /app +COPY --from=build /output . +ENV ASPNETCORE_ENVIRONMENT Docker +EXPOSE 5146 +ENTRYPOINT [ "./Server" ] \ No newline at end of file diff --git a/src/Server/appsettings.Docker.json b/src/Server/appsettings.Docker.json new file mode 100644 index 0000000..f569c4e --- /dev/null +++ b/src/Server/appsettings.Docker.json @@ -0,0 +1,41 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "Microsoft.AspNetCore": "Warning" + } + }, + "Kestrel":{ + "Endpoints": { + "http":{ + "Url": "http://0.0.0.0:5146" + } + } + }, + "UseSwagger": true, + "Embeddingsearch": { + "ConnectionStrings": { + "SQL": "server=localhost;database=embeddingsearch;uid=embeddingsearch;pwd=somepassword!;" + }, + "Elmah": { + "AllowedHosts": [ + "127.0.0.1", + "::1", + "172.17.0.1" + ] + }, + "AiProviders": { + "ollama": { + "handler": "ollama", + "baseURL": "http://localhost:11434" + }, + "localAI": { + "handler": "openai", + "baseURL": "http://localhost:8080", + "ApiKey": "Some API key here" + } + }, + "ApiKeys": ["Some UUID here", "Another UUID here"], + "UseHttpsRedirection": true + } +}