From 98bfba6bfe57888f1b0ed7363fd501ea76a95a65 Mon Sep 17 00:00:00 2001 From: syui Date: Sat, 13 Dec 2025 10:36:44 +0900 Subject: [PATCH] fix docker --- .env.example | 5 +++++ Dockerfile | 6 +++++- docker-compose.yml | 13 +++++++++++++ test/entrypoint.sh | 15 +++++++++++++-- 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 .env.example create mode 100644 docker-compose.yml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..5977d24 --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +# Admin handle (bot will respond to admin commands from this user) +ADMIN=syui.ai + +# Bluesky host (optional, default: bsky.social) +HOST=syu.is diff --git a/Dockerfile b/Dockerfile index 930c1af..651b9aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,11 @@ FROM syui/aios WORKDIR /root -ADD ./test/entrypoint.sh . + +COPY ./test/entrypoint.sh /root/entrypoint.sh RUN chmod +x /root/entrypoint.sh +ENV ADMIN="" +ENV HOST="bsky.social" + ENTRYPOINT ["/root/entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..49a36d1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +services: + bot: + image: syui/aios + container_name: aibot + restart: unless-stopped + command: ["aibot", "bot", "-a", "${ADMIN:-syui.ai}"] + volumes: + - ~/.config/syui/ai/bot:/root/.config/syui/ai/bot + logging: + driver: json-file + options: + max-size: "10m" + max-file: "3" diff --git a/test/entrypoint.sh b/test/entrypoint.sh index ad0a7aa..d66f15b 100644 --- a/test/entrypoint.sh +++ b/test/entrypoint.sh @@ -1,4 +1,15 @@ #!/bin/zsh -#aibot l $HANDLE -p $PASSWORD -s $HOST -aibot bot -a $ADMIN +set -e + +echo "Starting aibot..." +echo "ADMIN: ${ADMIN:-not set}" +echo "HOST: ${HOST:-bsky.social}" + +# 設定ファイルの存在確認 +if [ ! -f ~/.config/syui/ai/bot/token.toml ]; then + echo "Warning: token.toml not found. Please login first." +fi + +# botを起動 +exec aibot bot -a "${ADMIN}"