Refactor configuration handling and add Docker Compose setup for botbotbot service
All checks were successful
Push Docker image / build (push) Successful in 1m27s
All checks were successful
Push Docker image / build (push) Successful in 1m27s
This commit is contained in:
parent
aa69969728
commit
1e25826413
3 changed files with 11 additions and 1 deletions
|
@ -16,6 +16,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
uv sync --frozen --no-dev
|
uv sync --frozen --no-dev
|
||||||
|
|
||||||
ENV PATH="/app/.venv/bin:$PATH"
|
ENV PATH="/app/.venv/bin:$PATH"
|
||||||
|
ENV BOTBOTBOT_CONFIG="/config/config.toml"
|
||||||
|
|
||||||
ENTRYPOINT []
|
ENTRYPOINT []
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
import tomllib
|
import tomllib
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
@ -106,7 +107,9 @@ class ChaosBot:
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
logging.basicConfig(level=logging.INFO)
|
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)
|
config = tomllib.load(config_file)
|
||||||
|
|
||||||
chaos_bot = ChaosBot(config)
|
chaos_bot = ChaosBot(config)
|
||||||
|
|
6
compose.yaml
Normal file
6
compose.yaml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
services:
|
||||||
|
botbotbot:
|
||||||
|
container_name: botbotbot
|
||||||
|
image: code.edgarpierre.fr/edpibu/botbotbot:main
|
||||||
|
volumes:
|
||||||
|
- /docker/botbotbot/config:/config
|
Loading…
Add table
Add a link
Reference in a new issue