From da7df0fc45febb7600e15981506b965814458473 Mon Sep 17 00:00:00 2001 From: a Date: Mon, 12 Dec 2022 06:01:52 -0600 Subject: [PATCH] add docker support fix buffered output and missed var name fix missing comma change dockerfile to install ffmpeg and dependencies on top of archlinux fix pacman not syncing fix pacman not syncing fix pacman not autoconfirming fix missing pip --- .env.example | 2 +- Dockerfile | 7 +++++++ README.md | 2 +- cogs/vcjoin.py | 2 +- docker-compose.yml | 10 ++++++++++ 5 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.env.example b/.env.example index 827d095..941c02a 100644 --- a/.env.example +++ b/.env.example @@ -4,4 +4,4 @@ DISCORD_GUILD_ID = DISCORD_BOT_ADMIN_ROLE_ID = DISCORD_BOT_ADMIN_USER_ID = -DISCORD_VC_CHANNEL = \ No newline at end of file +DISCORD_VCJOIN_CHANNEL = \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9ffaaa8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM archlinux:latest +WORKDIR /umi +COPY . . +RUN pacman -Syu --noconfirm +RUN pacman -S --noconfirm python-pip libffi libsodium ffmpeg +RUN pip install -r requirements.txt +CMD ["python", "-u", "app.py"] \ No newline at end of file diff --git a/README.md b/README.md index 9d22119..88f6b36 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Copy `.env.example` to `.env`: - `DISCORD_BOT_ADMIN_ROLE_ID` for reloading cogs - `DISCORD_BOT_ADMIN_USER_ID` for reloading cogs -- `DISCORD_VC_CHANNEL` for the VCJoin cog +- `DISCORD_VCJOIN_CHANNEL` for the VCJoin cog ## Setup diff --git a/cogs/vcjoin.py b/cogs/vcjoin.py index d0b1096..ad41b5e 100644 --- a/cogs/vcjoin.py +++ b/cogs/vcjoin.py @@ -8,7 +8,7 @@ def setup(bot: discord.Bot): class VCJoin(Cog): """Log when a member joins VC, for pinging purposes""" - CHANNEL: int = config("DISCORD_VC_CHANNEL", cast=int) + CHANNEL: int = config("DISCORD_VCJOIN_CHANNEL", cast=int) def __init__(self, bot: discord.Bot): self.bot: discord.Bot = bot diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e707272 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3.9" +services: + app: + build: . + environment: + DISCORD_BOT_TOKEN: $DISCORD_BOT_TOKEN + DISCORD_GUILD_ID: $DISCORD_GUILD_ID + DISCORD_BOT_ADMIN_ROLE_ID: $DISCORD_BOT_ADMIN_ROLE_ID + DISCORD_BOT_ADMIN_USER_ID: $DISCORD_BOT_ADMIN_USER_ID + DISCORD_VCJOIN_CHANNEL: $DISCORD_VCJOIN_CHANNEL \ No newline at end of file