Refactor configuration handling and add Docker Compose setup for botbotbot service
All checks were successful
Push Docker image / build (push) Successful in 1m27s

This commit is contained in:
Edgar P. Burkhart 2025-05-05 10:23:49 +02:00
parent aa69969728
commit 1e25826413
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
3 changed files with 11 additions and 1 deletions

View file

@ -16,6 +16,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
ENV PATH="/app/.venv/bin:$PATH"
ENV BOTBOTBOT_CONFIG="/config/config.toml"
ENTRYPOINT []

View file

@ -1,4 +1,5 @@
import logging
import os
import tomllib
from typing import Any
@ -106,7 +107,9 @@ class ChaosBot:
def main() -> None:
logging.basicConfig(level=logging.INFO)
with open("config.toml", "rb") as config_file:
with open(
os.getenv("BOTBOTBOT_CONFIG", "/config/config.toml"), "rb"
) as config_file:
config = tomllib.load(config_file)
chaos_bot = ChaosBot(config)

6
compose.yaml Normal file
View file

@ -0,0 +1,6 @@
services:
botbotbot:
container_name: botbotbot
image: code.edgarpierre.fr/edpibu/botbotbot:main
volumes:
- /docker/botbotbot/config:/config