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

45
docker-compose.yml Normal file
View File

@@ -0,0 +1,45 @@
# creates the docker compose
version: '3.7'
# build individual services
services:
# setup discord bot container
discord:
build: ./ # find docker file in designated path
container_name: discord
restart: always # rebuild container always
environment:
CLIENT_TOKEN: ${CLIENT_TOKEN}
GUILD_ID: ${GUILD_ID}
CHANNEL_ID: ${CHANNEL_ID}
MODEL: ${MODEL}
CLIENT_UID: ${CLIENT_UID}
OLLAMA_IP: ${OLLAMA_IP}
OLLAMA_PORT: ${OLLAMA_PORT}
networks:
- ollama-net
volumes:
- discord:/src/app # docker will not make this for you, make it yourself
# setup ollama container
ollama:
image: ollama/ollama:latest # build the image using ollama
container_name: ollama
restart: always
networks:
- ollama-net
# runtime: nvidia # use Nvidia Container Toolkit for GPU support
# devices:
# - /dev/nvidia0
volumes:
- ollama:/root/.ollama
ports:
- 11434:11434
networks:
ollama-net:
driver: bridge
volumes:
ollama:
discord: