From 9a31f13263437f599115a469ab5d2bd6bd2f47e7 Mon Sep 17 00:00:00 2001 From: Midka Date: Sun, 16 Oct 2022 18:43:24 +0300 Subject: [PATCH] add: autodeployment configuration with watchtower --- .env.example | 4 +++- docker-compose.yml | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 295c868..841244a 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,4 @@ DISCORD_TOKEN= -GUILD_ID= \ No newline at end of file + +# webhook url for autodeployment notifications, works with discord too if you add /slack to the end +DEPLOY_SLACK_WEBHOOK_URL= diff --git a/docker-compose.yml b/docker-compose.yml index dff556c..d08b514 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,9 +4,21 @@ services: bot: image: ghcr.io/hacksquaddev/discord-rust:main # build: . + container_name: hacksquad-rust-bot environment: - DISCORD_TOKEN=${DISCORD_TOKEN} - REDIS_URI=redis://redis/ redis: image: redis:latest + + watchtower: + image: containrrr/watchtower + container_name: watchtower + volumes: + - /var/run/docker.sock:/var/run/docker.sock + command: --interval 500 hacksquad-rust-bot + environment: + - WATCHTOWER_NOTIFICATIONS=slack + # works with discord if you add /slack to the end + - WATCHTOWER_NOTIFICATION_SLACK_HOOK_URL=${DEPLOY_SLACK_WEBHOOK_URL}