Skip to content

Commit 98cada4

Browse files
authored
Merge pull request #307 from SciSharp/docker
Docker
2 parents 0e0085a + fc679b7 commit 98cada4

24 files changed

+463
-128
lines changed

dockerfiles/.env

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# MongoDB Configuration
2+
ENV_MONGO_DB_HOST=botsharp_mongo
3+
ENV_MONGO_DB_PORT=27017
4+
ENV_MONGO_DB_DATABASE=botsharp
5+
ENV_MONGO_INITDB_ROOT_USERNAME=root
6+
ENV_MONGO_INITDB_ROOT_PASSWORD=admin
7+
ASPNETCORE_HTTP_PORTS=5500
8+
9+
10+
11+
12+
13+

dockerfiles/ARTICULATE.Dockerfile

Lines changed: 0 additions & 16 deletions
This file was deleted.

dockerfiles/DIALOGFLOW.Dockerfile

Lines changed: 0 additions & 16 deletions
This file was deleted.

dockerfiles/RASA.Dockerfile

Lines changed: 0 additions & 16 deletions
This file was deleted.

dockerfiles/Readme.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Run Container
2+
3+
# Prerequisites:
4+
1. Install Powershell
5+
2. Install Docker Environment
6+
7+
# start container
8+
9+
```
10+
run-docker-compose.ps1
11+
```
12+
13+
# stop container
14+
```
15+
stop-docker-compose.ps1
16+
```

dockerfiles/WebStarter.Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
2+
3+
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base
4+
USER app
5+
WORKDIR /app
6+
EXPOSE 5500
7+
8+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
9+
ARG BUILD_CONFIGURATION=Release
10+
WORKDIR /src
11+
COPY ["Directory.Build.props", "."]
12+
COPY ["src/WebStarter/WebStarter.csproj", "src/WebStarter/"]
13+
COPY ["tests/BotSharp.Plugin.PizzaBot/BotSharp.Plugin.PizzaBot.csproj", "tests/BotSharp.Plugin.PizzaBot/"]
14+
COPY ["src/Infrastructure/BotSharp.Core/BotSharp.Core.csproj", "src/Infrastructure/BotSharp.Core/"]
15+
COPY ["src/Infrastructure/BotSharp.Abstraction/BotSharp.Abstraction.csproj", "src/Infrastructure/BotSharp.Abstraction/"]
16+
COPY ["src/Infrastructure/BotSharp.Logger/BotSharp.Logger.csproj", "src/Infrastructure/BotSharp.Logger/"]
17+
COPY ["src/Infrastructure/BotSharp.OpenAPI/BotSharp.OpenAPI.csproj", "src/Infrastructure/BotSharp.OpenAPI/"]
18+
COPY ["src/Plugins/BotSharp.Plugin.GoogleAI/BotSharp.Plugin.GoogleAI.csproj", "src/Plugins/BotSharp.Plugin.GoogleAI/"]
19+
COPY ["src/Plugins/BotSharp.Plugin.MongoStorage/BotSharp.Plugin.MongoStorage.csproj", "src/Plugins/BotSharp.Plugin.MongoStorage/"]
20+
COPY ["src/Plugins/BotSharp.Plugin.AzureOpenAI/BotSharp.Plugin.AzureOpenAI.csproj", "src/Plugins/BotSharp.Plugin.AzureOpenAI/"]
21+
COPY ["src/Plugins/BotSharp.Plugin.ChatbotUI/BotSharp.Plugin.ChatbotUI.csproj", "src/Plugins/BotSharp.Plugin.ChatbotUI/"]
22+
COPY ["src/Plugins/BotSharp.Plugin.HuggingFace/BotSharp.Plugin.HuggingFace.csproj", "src/Plugins/BotSharp.Plugin.HuggingFace/"]
23+
COPY ["src/Plugins/BotSharp.Plugin.KnowledgeBase/BotSharp.Plugin.KnowledgeBase.csproj", "src/Plugins/BotSharp.Plugin.KnowledgeBase/"]
24+
COPY ["src/Plugins/BotSharp.Plugin.MetaAI/BotSharp.Plugin.MetaAI.csproj", "src/Plugins/BotSharp.Plugin.MetaAI/"]
25+
COPY ["src/Plugins/BotSharp.Plugin.MetaMessenger/BotSharp.Plugin.MetaMessenger.csproj", "src/Plugins/BotSharp.Plugin.MetaMessenger/"]
26+
COPY ["src/Plugins/BotSharp.Plugin.Qdrant/BotSharp.Plugin.Qdrant.csproj", "src/Plugins/BotSharp.Plugin.Qdrant/"]
27+
COPY ["src/Plugins/BotSharp.Plugin.RoutingSpeeder/BotSharp.Plugin.RoutingSpeeder.csproj", "src/Plugins/BotSharp.Plugin.RoutingSpeeder/"]
28+
COPY ["src/Plugins/BotSharp.Plugin.WeChat/BotSharp.Plugin.WeChat.csproj", "src/Plugins/BotSharp.Plugin.WeChat/"]
29+
COPY ["src/Plugins/BotSharp.Plugin.SemanticKernel/BotSharp.Plugin.SemanticKernel.csproj", "src/Plugins/BotSharp.Plugin.SemanticKernel/"]
30+
COPY ["src/Plugins/BotSharp.Plugin.Twilio/BotSharp.Plugin.Twilio.csproj", "src/Plugins/BotSharp.Plugin.Twilio/"]
31+
COPY ["src/Plugins/BotSharp.Plugin.TelegramBots/BotSharp.Plugin.TelegramBots.csproj", "src/Plugins/BotSharp.Plugin.TelegramBots/"]
32+
COPY ["src/Plugins/BotSharp.Plugin.ChatHub/BotSharp.Plugin.ChatHub.csproj", "src/Plugins/BotSharp.Plugin.ChatHub/"]
33+
COPY ["src/Plugins/BotSharp.Plugin.HttpHandler/BotSharp.Plugin.HttpHandler.csproj", "src/Plugins/BotSharp.Plugin.HttpHandler/"]
34+
COPY ["src/Plugins/BotSharp.Plugin.LLamaSharp/BotSharp.Plugin.LLamaSharp.csproj", "src/Plugins/BotSharp.Plugin.LLamaSharp/"]
35+
COPY ["src/Plugins/BotSharp.Plugin.SqlDriver/BotSharp.Plugin.SqlDriver.csproj", "src/Plugins/BotSharp.Plugin.SqlDriver/"]
36+
COPY ["src/Plugins/BotSharp.Plugin.WebDriver/BotSharp.Plugin.WebDriver.csproj", "src/Plugins/BotSharp.Plugin.WebDriver/"]
37+
RUN dotnet restore "./src/WebStarter/./WebStarter.csproj"
38+
COPY . .
39+
WORKDIR "/src/src/WebStarter"
40+
RUN dotnet build "./WebStarter.csproj" -c $BUILD_CONFIGURATION -o /app/build /p:SolutionName=BotSharp
41+
42+
FROM build AS publish
43+
ARG BUILD_CONFIGURATION=Release
44+
RUN dotnet publish "./WebStarter.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false /p:SolutionName=BotSharp
45+
46+
FROM base AS final
47+
WORKDIR /app
48+
COPY --from=publish /app/publish .
49+
ENTRYPOINT ["dotnet", "WebStarter.dll"]

dockerfiles/appsettings.json

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"AllowedHosts": "*",
9+
"AllowedOrigins": [
10+
"http://localhost:5015"
11+
],
12+
13+
"Jwt": {
14+
"Issuer": "botsharp",
15+
"Audience": "botsharp",
16+
"Key": "31ba6052aa6f4569901facc3a41fcb4adfd9b46dd00c40af8a753fbdc2b89869"
17+
},
18+
19+
"OAuth": {
20+
"GitHub": {
21+
"ClientId": "",
22+
"ClientSecret": ""
23+
},
24+
"Google": {
25+
"ClientId": "",
26+
"ClientSecret": ""
27+
},
28+
"Keycloak": {
29+
"BaseAddress": "http://keycloak.localhost:8080",
30+
"Realm": "master",
31+
"ClientId": "botsharp",
32+
"ClientSecret": "36FeOoyZzkOWrRZLmhwxplC2kGbFGn68",
33+
"Version": 22
34+
}
35+
},
36+
37+
"LlmProviders": [
38+
{
39+
"Provider": "azure-openai",
40+
"Models": [
41+
{
42+
"Name": "gpt-35-turbo",
43+
"ApiKey": "",
44+
"Endpoint": "https://ai4c-demo.openai.azure.com/",
45+
"Type": "chat",
46+
"PromptCost": 0.0015,
47+
"CompletionCost": 0.002
48+
},
49+
{
50+
"Name": "gpt-35-turbo-instruct",
51+
"ApiKey": "",
52+
"Endpoint": "https://gpt-35-turbo-instruct.openai.azure.com/",
53+
"Type": "text",
54+
"PromptCost": 0.0015,
55+
"CompletionCost": 0.002
56+
}
57+
]
58+
},
59+
{
60+
"Provider": "llama-sharp",
61+
"Models": [
62+
{
63+
"Name": "llama-2-7b-guanaco-qlora.Q2_K.gguf",
64+
"Type": "chat"
65+
}
66+
]
67+
},
68+
{
69+
"Provider": "huggingface",
70+
"Models": [
71+
{
72+
"Name": "mistralai/Mistral-7B-v0.1",
73+
"Type": "text"
74+
},
75+
{
76+
"Name": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
77+
"Type": "text"
78+
}
79+
]
80+
}
81+
],
82+
83+
"Router": {
84+
},
85+
86+
"Evaluator": {
87+
"AgentId": "dfd9b46d-d00c-40af-8a75-3fbdc2b89869"
88+
},
89+
90+
"Agent": {
91+
"DataDir": "agents",
92+
"TemplateFormat": "liquid",
93+
"HostAgentId": "01e2fc5c-2c89-4ec7-8470-7688608b496c",
94+
"LlmConfig": {
95+
"Provider": "azure-openai",
96+
"Model": "gpt-35-turbo"
97+
}
98+
},
99+
100+
"Conversation": {
101+
"DataDir": "conversations",
102+
"ShowVerboseLog": false,
103+
"EnableLlmCompletionLog": false,
104+
"EnableExecutionLog": true,
105+
"EnableContentLog": true,
106+
"EnableStateLog": true
107+
},
108+
109+
"Statistics": {
110+
"DataDir": "stats"
111+
},
112+
113+
"LlamaSharp": {
114+
"Interactive": true,
115+
"ModelDir": "C:/Users/haipi/Downloads",
116+
"DefaultModel": "llama-2-7b-chat.Q8_0.gguf",
117+
"MaxContextLength": 1024,
118+
"NumberOfGpuLayer": 20
119+
},
120+
121+
"AzureOpenAi": {
122+
},
123+
124+
"GoogleAi": {
125+
"PaLM": {
126+
"Endpoint": "https://generativelanguage.googleapis.com",
127+
"ApiKey": ""
128+
}
129+
},
130+
131+
"HuggingFace": {
132+
"Endpoint": "https://api-inference.huggingface.co",
133+
"Model": "tiiuae/falcon-180B-chat",
134+
"Token": ""
135+
},
136+
137+
"MetaAi": {
138+
"fastText": {
139+
"ModelPath": "dbpedia.ftz"
140+
}
141+
},
142+
143+
"RoutingSpeeder": {
144+
},
145+
146+
"MetaMessenger": {
147+
"Endpoint": "https://graph.facebook.com",
148+
"ApiVersion": "v17.0",
149+
"PageId": "",
150+
"PageAccessToken": ""
151+
},
152+
153+
"Twilio": {
154+
"PhoneNumber": "+1",
155+
"AccountSID": "",
156+
"AuthToken": "",
157+
"CallbackHost": "https://",
158+
"AgentId": "01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a"
159+
},
160+
161+
"Database": {
162+
"Default": "MongoRepository",
163+
"TablePrefix": "BotSharp",
164+
"BotSharpMongoDb": "mongodb://root:admin@botsharp_mongo:27017/botsharp?authSource=admin&authMechanism=SCRAM-SHA-256",
165+
"FileRepository": "data",
166+
"Assemblies": [ "BotSharp.Core" ]
167+
},
168+
169+
"Qdrant": {
170+
"Url": "",
171+
"ApiKey": ""
172+
},
173+
174+
"WeChat": {
175+
"AgentId": "437bed34-1169-4833-95ce-c24b8b56154a",
176+
"Token": "#{Token}#",
177+
"EncodingAESKey": "#{EncodingAESKey}#",
178+
"WeixinAppId": "#{WeixinAppId}#",
179+
"WeixinAppSecret": "#{WeixinAppSecret}#"
180+
},
181+
182+
"KnowledgeBase": {
183+
"VectorDb": "MemVectorDatabase",
184+
"TextEmbedding": "fastTextEmbeddingProvider",
185+
"TextCompletion": "AzureOpenAI.Providers.TextCompletionProvider",
186+
"Pdf2TextConverter": "PigPdf2TextConverter"
187+
},
188+
189+
"PluginLoader": {
190+
"Assemblies": [
191+
"BotSharp.Core",
192+
"BotSharp.Logger",
193+
"BotSharp.Plugin.MongoStorage",
194+
"BotSharp.Plugin.Dashboard",
195+
"BotSharp.Plugin.AzureOpenAI",
196+
"BotSharp.Plugin.GoogleAI",
197+
"BotSharp.Plugin.MetaAI",
198+
"BotSharp.Plugin.MetaMessenger",
199+
"BotSharp.Plugin.HuggingFace",
200+
"BotSharp.Plugin.KnowledgeBase",
201+
"BotSharp.Plugin.Qdrant",
202+
"BotSharp.Plugin.ChatHub",
203+
"BotSharp.Plugin.WeChat",
204+
"BotSharp.Plugin.PizzaBot",
205+
"BotSharp.Plugin.WebDriver",
206+
"BotSharp.Plugin.LLamaSharp"
207+
]
208+
}
209+
}

0 commit comments

Comments
 (0)