Docker Container Setup (#15)

* minor package update and env

* added docker scripts

* added working docker compose

* fixed docker container bridge
This commit is contained in:
Kevin Dang
2024-02-07 09:59:06 -08:00
committed by GitHub
parent 89c19990fa
commit ca6b8c3f9c
13 changed files with 124 additions and 337 deletions

View File

@@ -1,6 +1,7 @@
import { Client, GatewayIntentBits } from 'discord.js'
import { registerEvents } from './utils/events.js'
import Events from './events/index.js'
import { Ollama } from 'ollama'
// Import keys/tokens
import Keys from './keys.js'
@@ -16,6 +17,11 @@ const client = new Client({
]
});
// initialize connection to ollama container
const ollama = new Ollama({
host: `http://${Keys.ipAddress}:${Keys.portAddress}`,
})
const messageHistory = [
{
role: 'system',
@@ -30,7 +36,7 @@ const messageHistory = [
* @param client the bot reference
* @param Keys tokens from .env files
*/
registerEvents(client, Events, messageHistory, Keys)
registerEvents(client, Events, messageHistory, Keys, ollama)
// Try to log in the client
await client.login(Keys.clientToken)