From a3327a505c20f14a319c355ce9e9f694044a4639 Mon Sep 17 00:00:00 2001 From: mitsuha_s Date: Tue, 26 Jul 2022 19:38:38 +0000 Subject: [PATCH] remove invalid values in docker-compose.yml and add little documentation for environment values --- Dockerfile | 8 ++++++++ docker-compose.yml | 21 +++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index d9c2d9b..b8a77a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,14 @@ RUN pip install -r requirements.txt ENV PYTHONUNBUFFERED=1 +# App settings +# https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING +ENV RSSBOT_DSN=postgres://username:password@hostname/database_name +# https://core.telegram.org/bots#6-botfather +ENV RSSBOT_TG_TOKEN=1234567890:yourbotstoken +# https://docs.python.org/3/howto/logging.html#logging-levels +ENV LOG_LEVEL=INFO + ENTRYPOINT [ "python" ] CMD [ "bot.py" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 8a5bed1..797a9cf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,24 +2,25 @@ version: '3.7' services: rss-bot: - build: . - image: rss_bot - # App settings - # DSN schema: postgres://username:password@hostname/database_name + image: miroslavsckaya/tg_rss_bot environment: - - RSSBOT_DSN=xxx - - RSSBOT_TG_TOKEN=xxx - - LOG_LEVEL=INFO + # DSN schema: postgres://username:password@hostname/database_name + # https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING + - "RSSBOT_DSN=${BOT_DSN}" + # https://core.telegram.org/bots#6-botfather + - "RSSBOT_TG_TOKEN=${BOT_TOKEN}" + # https://docs.python.org/3/howto/logging.html#logging-levels + - "LOG_LEVEL=${BOT_LOG_LEVEL:-INFO}" container_name: rss_bot depends_on: - postgres postgres: image: postgres:14-alpine - # Postgres settings. - # Can use POSTGRES_DB variable. https://hub.docker.com/_/postgres environment: - - POSTGRES_PASSWORD=xxx + # Postgres settings + # Can use POSTGRES_DB variable. https://hub.docker.com/_/postgres + - "POSTGRES_PASSWORD=${POSTGRES_PASS}" volumes: - postgres_bot_db:/var/lib/postgresql/data