From e1991586323478b63a7b838b378c16c16149522f Mon Sep 17 00:00:00 2001 From: "Michael D.M. Dryden" Date: Sun, 1 Aug 2021 19:10:05 -0400 Subject: [PATCH] Added Dockerfile and docker-compose config --- Dockerfile | 17 +++++++++++++++++ README.rst | 9 +++++++++ docker-compose.yml | 29 +++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e8dab8d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.9 + +WORKDIR /usr/src/app + +COPY . . +RUN pip install --no-cache-dir poetry +RUN poetry install + +ENV TZ="America/Toronto" \ + BOT_TOKEN=-1 \ + CHAT_ID=0 \ + POSTGRES_USER=postgres \ + POSTGRES_PASSWORD=password \ + POSTGRES_HOST=db \ + POSTGRES_DB=telegram_bot + +CMD [ "sh", "-c", "poetry run python -m telegram_stats_bot.main --tz=$TZ $BOT_TOKEN $CHAT_ID postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB" ] \ No newline at end of file diff --git a/README.rst b/README.rst index f5b874e..23ede81 100644 --- a/README.rst +++ b/README.rst @@ -35,6 +35,8 @@ Table of contents - `Installation`_ +- `Docker`_ + - `Setup`_ - `Fetching Stats`_ @@ -133,6 +135,13 @@ Or you can install the latest git version using `poetry