* added message style command * docker setup scripts * reformat messageStyle.ts * fix: register unregister on deploy * add: messageStream preference * add: json config handler * update: messageCreate gets config * update: shifted chat to config callback * fix: naming conventions based on discord * update: setup in docs now * add: static docker ips * version increment * add: bot message for no config * fix: no config case * add: clarification for subnetting * update: version increment in lock file --------- Co-authored-by: JT2M0L3Y <jtsmoley@icloud.com>
2.7 KiB
2.7 KiB
Docker Setup
- Follow this guide to setup Docker
- If on Windows, download Docker Desktop to get the docker engine.
- Please also install Docker Compose for easy running. If not, there are scripts to set everything up.
To Run (with Docker and Docker Compose)
- With the inclusion of subnets in the
docker-compose.yml, you will need to set theSUBNET_ADDRESS,OLLAMA_IP,OLLAMA_PORT, andDISCORD_IP. Here are some default values if you don't care:OLLAMA_IP = 172.18.0.2OLLAMA_PORT = 11434DISCORD_IP = 172.18.0.3SUBNET_ADDRESS = 172.18.0.0- Don't understand any of this? watch a Networking video to understand subnetting.
- You will need a model in the container for this to work properly, on Docker Desktop go to the
Containerstab, select theollamacontainer, and selectExecto run as root on your container. Now, runollama pull [model name]to get your model.- For Linux Servers, you need another shell to pull the model, or if you run
docker compose build && docker compose up -d, then it will run in the background to keep your shell. Rundocker exec -it ollama bashto get into the container and run the samme pull command above.
- For Linux Servers, you need another shell to pull the model, or if you run
- Otherwise, there is no need to install any npm packages for this, you just need to run
npm run startto pull the containers and spin them up. - For cleaning up on Linux (or Windows), run the following commands:
docker compose stopdocker compose rmdocker psto check if containers have been removed.
- You can also use
npm run cleanto clean up the containers and remove the network to address a possibleAddress already in useproblem.
Manual Run (with Docker)
- Run the following commands:
npm run docker:buildnpm run docker:ollamanpm run docker:clientdocker psto see if the containers are there!- Names should be discord and ollama.
- You can also just run
npm run docker:startnow for the above commands.
- Clean-up:
docker psfor the conatiner id's. Use-aflag as necessary.docker rm -f discord && docker rm -f ollamato remove the containers.docker rm -f CONTAINER_IDdo for both containers if naming issues arise.
docker network rm ollama-netremoves the network.docker network prunewill also work so long as the network is unused.
- Remove Image:
- If you need to remove the image run
docker image rm IMAGE_ID. You can get the image id by runningdocker images.
- If you need to remove the image run