diff --git a/README.md b/README.md index 7156e5d..2455ee2 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ docker run -d --restart=always --name=serverstatus -v ~/serverstatus-config.json `ServerStatus`: docker-compose up -d -`ServerStatus with tgbot`: docker-compose -f docker-compose-telegram.yml up -d +`ServerStatus with tgbot`: TG_CHAT_ID=你的电报ID TG_BOT_TOKEN=你的电报密钥 docker-compose -f docker-compose-telegram.yml up -d ``` diff --git a/docker-compose-telegram.yml b/docker-compose-telegram.yml index 83656ad..d5ba31b 100644 --- a/docker-compose-telegram.yml +++ b/docker-compose-telegram.yml @@ -4,7 +4,7 @@ services: build: context: . dockerfile: Dockerfile - image: cppla/serverstatus:latest + image: serverstatus_server container_name: serverstatus restart: unless-stopped networks: @@ -20,14 +20,15 @@ services: build: context: ./plugin dockerfile: Dockerfile-telegram + image: serverstatus_bot container_name: bot4sss restart: unless-stopped networks: serverstatus-network: ipv4_address: 172.23.0.3 environment: - - TG_CHAT_ID=tg_chat_id - - TG_BOT_TOKEN=tg_bot_token + - TG_CHAT_ID=${TG_CHAT_ID} + - TG_BOT_TOKEN=${TG_BOT_TOKEN} networks: serverstatus-network: diff --git a/docker-compose.yml b/docker-compose.yml index 3091116..4701199 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,7 @@ services: build: context: . dockerfile: Dockerfile + image: serverstatus_server container_name: serverstatus restart: unless-stopped networks: diff --git a/plugin/Dockerfile-telegram b/plugin/Dockerfile-telegram index e42e0ee..f9084ef 100644 --- a/plugin/Dockerfile-telegram +++ b/plugin/Dockerfile-telegram @@ -1,9 +1,10 @@ -FROM nyurik/alpine-python3-requests +FROM python:alpine LABEL maintainer="lidalao" LABEL version="0.0.1" LABEL description="Telegram Bot for ServerStatus" WORKDIR /app +RUN pip install requests COPY ./bot-telegram.py . CMD [ "python", "./bot-telegram.py" ]