Fix voice in container

This commit is contained in:
2021-01-17 17:42:44 +01:00
parent 533b849117
commit 4cb20aa771
3 changed files with 7 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
FROM python:3
FROM python:3.9.1-alpine
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN apk add ffmpeg musl-dev linux-headers gcc libffi-dev make opus
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["bot.py"]

3
bot.py
View File

@@ -47,6 +47,9 @@ last_loeh = 0
config_load()
bot = commands.Bot(command_prefix=config.get('prefix'))
if 'LIBOPUS' in os.environ and not len(os.environ['LIBOPUS']) == 0:
discord.opus.load_opus(os.environ['LIBOPUS'])
async def get_loeh(guild: discord.Guild) -> Optional[discord.Member]:
try:

View File

@@ -4,3 +4,5 @@ services:
build: .
stdin_open: true
tty: true
environment:
LIBOPUS: "/usr/lib/libopus.so.0"