From 6876fb741c74bf17ce908a8641ce3af62c01429a 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 +++++ .gitignore | 1 + Dockerfile | 6 ++---- compose.yml | 19 ++++++++++++------- test/entrypoint.sh | 4 ---- 5 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 .env.example delete mode 100644 test/entrypoint.sh 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/.gitignore b/.gitignore index ac28386..ed44237 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ pnpm-lock.yaml */target/ */**/*.rs.bk .claude +.config diff --git a/Dockerfile b/Dockerfile index 930c1af..4409f76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM syui/aios -WORKDIR /root -ADD ./test/entrypoint.sh . -RUN chmod +x /root/entrypoint.sh +COPY ./target/release/aibot /usr/sbin/aibot -ENTRYPOINT ["/root/entrypoint.sh"] +WORKDIR /root diff --git a/compose.yml b/compose.yml index 43fba25..1f9039d 100644 --- a/compose.yml +++ b/compose.yml @@ -1,11 +1,16 @@ services: - aios: - #image: syui/aios - #command: aibot bot -a syui.syu.is + bot: build: context: . - restart: always - env_file: - - .env + dockerfile: Dockerfile + image: syui/aios:custom + container_name: aibot + restart: unless-stopped + command: ["aibot", "bot", "-a", "${ADMIN:-syui.ai}"] volumes: - - ./.config:/root/.config + - ./.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 deleted file mode 100644 index ad0a7aa..0000000 --- a/test/entrypoint.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/zsh - -#aibot l $HANDLE -p $PASSWORD -s $HOST -aibot bot -a $ADMIN