Added Docker support for the Indexer

This commit is contained in:
2025-06-15 13:56:55 +02:00
parent d95c1c57bb
commit 7d566cd921
8 changed files with 91 additions and 4 deletions

14
src/Indexer/Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM ubuntu:24.04 AS ubuntu
WORKDIR /app
RUN apt-get update
RUN apt-get install -y python3.12 python3.12-venv python3.12-dev dotnet-sdk-8.0
RUN apt-get clean
COPY . /src/
ENV ASPNETCORE_ENVIRONMENT Docker
RUN rm /src/Server/appsettings*
RUN dotnet build /src/Indexer/Indexer.csproj
RUN dotnet publish /src/Indexer/Indexer.csproj -c Release -o /app
RUN cp -r /src/Indexer/Scripts /app/Scripts
RUN rm -r /src
ENV PYTHONIOENCODING=utf8
ENTRYPOINT ["./Indexer"]

View File

@@ -40,7 +40,7 @@ def index_files(toolset: Toolset):
jsonEntities:list = []
for filename in os.listdir(example_content):
qualified_filepath = example_content + "/" + filename
with open(qualified_filepath, "r") as file:
with open(qualified_filepath, "r", encoding='utf-8') as file:
title = file.readline()
text = file.read()
datapoints:list = [

View File

@@ -12,7 +12,7 @@
"Worker":
[
{
"Name": "example",
"Name": "pythonExample",
"Searchdomains": [
"example"
],
@@ -20,7 +20,7 @@
"Calls": [
{
"Type": "interval",
"Interval": 60000
"Interval": 30000
}
]
}

View File

@@ -0,0 +1,37 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"Kestrel":{
"Endpoints": {
"http":{
"Url": "http://0.0.0.0:5120"
}
}
},
"Embeddingsearch": {
"BaseUri": "http://172.17.0.1:5146",
"ApiKeys": ["b54ea868-496e-11f0-9cc7-f79f06b160e5", "bbdeedf0-496e-11f0-9744-97e28c221f67"]
},
"EmbeddingsearchIndexer": {
"Worker":
[
{
"Name": "pythonExample",
"Searchdomains": [
"example"
],
"Script": "Scripts/example.py",
"Calls": [
{
"Type": "interval",
"Interval": 30000
}
]
}
]
}
}

View File

@@ -0,0 +1,29 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"Embeddingsearch": {
"BaseUri": "http://localhost:5146"
},
"EmbeddingsearchIndexer": {
"Worker":
[
{
"Name": "pythonExample",
"Searchdomains": [
"example"
],
"Script": "Scripts/example.py",
"Calls": [
{
"Type": "interval",
"Interval": 30000
}
]
}
]
}
}

View File

@@ -8,7 +8,7 @@
"Kestrel":{
"Endpoints": {
"http":{
"Url": "http://localhost:5146"
"Url": "http://0.0.0.0:5146"
}
}
},