Further docker advances
This commit is contained in:
parent
90c7293d14
commit
85ab1f9539
3 changed files with 31 additions and 3 deletions
25
docker-compose.yml
Normal file
25
docker-compose.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
services:
|
||||
sentient-jimmy:
|
||||
image: sentient-jimmy:latest
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:password@db:5432/postgres
|
||||
volumes:
|
||||
- ./config.toml:/jimmy/config.toml:ro
|
||||
db:
|
||||
image: postgres:16
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=postgres
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data/
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
|
||||
interval: 1s
|
||||
timeout: 30s
|
||||
retries: 10
|
||||
volumes:
|
||||
postgres_data:
|
|
@ -9,9 +9,9 @@ import discord
|
|||
from discord import Interaction
|
||||
from ollama import AsyncClient, ResponseError, Options
|
||||
from discord.ext import commands
|
||||
from jimmy .utils import create_ollama_message, find_suitable_server, decorate_server_name as decorate_name
|
||||
from jimmy .config import get_servers, get_server
|
||||
from jimmy .db import OllamaThread
|
||||
from jimmy.utils import create_ollama_message, find_suitable_server, decorate_server_name as decorate_name
|
||||
from jimmy.config import get_servers, get_server
|
||||
from jimmy.db import OllamaThread
|
||||
from humanize import naturalsize, naturaldelta
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import os
|
||||
import tomllib
|
||||
import logging
|
||||
from typing import Callable
|
||||
|
@ -66,4 +67,6 @@ def get_config():
|
|||
_loaded.setdefault("servers", {})
|
||||
_loaded["servers"].setdefault("order", [])
|
||||
_loaded.setdefault("bot", {})
|
||||
if database_url := os.getenv("DATABASE_URL"):
|
||||
_loaded["bot"]["db_url"] = database_url
|
||||
return _loaded
|
||||
|
|
Loading…
Reference in a new issue