From 0ad9276f3d2ea288e4ec3066467c3f8f54a0a9ba Mon Sep 17 00:00:00 2001 From: The0Mikkel Date: Tue, 28 May 2024 01:01:46 +0200 Subject: [PATCH] chore(docker): add docker compose file that use pre-built docker image --- README.md | 9 +++++++++ docker-compose.prod.yml | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 docker-compose.prod.yml diff --git a/README.md b/README.md index 0280d6d..0de883b 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,15 @@ This Discord chatbot is built to follow the chat flow and have a conversation wi *This will use the Ollama installed and running on your system. This will therefore allow for people to use ressources on your machine. If you want to use a different Ollama instance, you can set the `OLLAMA_SCHEME`, `OLLAMA_HOST` and `OLLAMA_PORT` variables in the `.env` file.* +### Running used pre-built image + +The project provides a pre-built image, which can be used to run the bot. This is useful if you do not want to build the image yourself. + +Image is available at `ghcr.io/the0mikkel/ollama-discord-bot:latest`. + +A provided [docker-compose.prod.yml](docker-compose.prod.yml) file can be used to run the bot using the pre-built image. +Just copy it to `docker-compose.yml` and run `docker-compose up -d`. + ## Features The bot listen in and is able to have a conversation with the user. The bot has the whole chat flow of a single channel. This means, even though the bot is not interacted with, it can be called in, and have the previous messages in context. diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..5cf48b9 --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,38 @@ +version: '3' +services: + bot: + container_name: bot + image: ghcr.io/the0mikkel/ollama-discord-bot:latest + restart: always + stop_grace_period: 1s + env_file: + - bot.env + networks: + - redis + extra_hosts: + - host.docker.internal:host-gateway + depends_on: + redis: + condition: service_healthy + + redis: + container_name: redis + image: redis/redis-stack-server:latest + restart: always + volumes: + - redis:/data + networks: + - redis + expose: + - 6379 + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 30s + timeout: 10s + retries: 5 + +networks: + redis: + +volumes: + redis: