From 3c3f97cddcf977af67e60e31af8fa769138cc566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Sat, 25 Nov 2023 01:02:55 +0100 Subject: [PATCH] Dockerfile + LOG_LEVEL --- Dockerfile | 17 +++++++++++++++++ lenaverse_bot/__init__.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c327b4a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.11-slim + +# env setup +WORKDIR /usr/local/src/lenaverse_bot + +# install lenaverse_bot +COPY . ./ +RUN set -ex; \ + # remove example app + rm -rf /app; \ + \ + python -m pip --no-cache-dir install ./ + +# run as unprivileged user +USER nobody + +CMD [ "lenaverse-bot" ] diff --git a/lenaverse_bot/__init__.py b/lenaverse_bot/__init__.py index 9254a05..02f491e 100644 --- a/lenaverse_bot/__init__.py +++ b/lenaverse_bot/__init__.py @@ -6,4 +6,4 @@ import discord discord.utils.setup_logging() _logger = logging.getLogger(__name__) -_logger.setLevel(os.getenv("LOG_LEVEL", logging.WARN)) +_logger.setLevel(os.getenv("LOG_LEVEL", logging.INFO))