From c63fb083b42ec4dc2075f4885a0d7d3833de4d0b Mon Sep 17 00:00:00 2001 From: djeck1432 Date: Sun, 24 Nov 2024 21:10:31 +0100 Subject: [PATCH 1/2] add dev docker for web-app --- apps/web_app/telegram/__main__.py | 6 ++++-- devops/dev/docker-compose.notification-app.yaml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/web_app/telegram/__main__.py b/apps/web_app/telegram/__main__.py index f4d4fa73..dec7b064 100644 --- a/apps/web_app/telegram/__main__.py +++ b/apps/web_app/telegram/__main__.py @@ -1,3 +1,4 @@ +import os import asyncio from aiogram.types import BotCommand, BotCommandScopeDefault @@ -24,5 +25,6 @@ async def bot_start_polling(): if __name__ == "__main__": - loop = asyncio.get_event_loop() - loop.run_until_complete(bot_start_polling()) + if os.getenv("ENV") == "DEV": + loop = asyncio.get_event_loop() + loop.run_until_complete(bot_start_polling()) diff --git a/devops/dev/docker-compose.notification-app.yaml b/devops/dev/docker-compose.notification-app.yaml index 4c0a34e6..5eedb272 100644 --- a/devops/dev/docker-compose.notification-app.yaml +++ b/devops/dev/docker-compose.notification-app.yaml @@ -33,7 +33,7 @@ services: volumes: - ../../apps/web_app:/app env_file: - - ../../apps/web_app/.env + - ../../apps/web_app/.env.dev expose: - "8000" depends_on: From 0bc9a701c7f2abee73a196602c6cdb541fe90f9d Mon Sep 17 00:00:00 2001 From: djeck1432 Date: Sun, 24 Nov 2024 21:10:41 +0100 Subject: [PATCH 2/2] add env dev for web_app --- apps/web_app/.env.dev | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 apps/web_app/.env.dev diff --git a/apps/web_app/.env.dev b/apps/web_app/.env.dev new file mode 100644 index 00000000..c4d4d930 --- /dev/null +++ b/apps/web_app/.env.dev @@ -0,0 +1,13 @@ +DERISK_API_URL=# + +ENV=dev +# PostgreSQL +DB_USER=postgres +DB_PASSWORD=password +DB_NAME=web_app +DB_HOST=db +DB_PORT=5432 + +TELEGRAM_TOKEN=# + +DATA_HANDLER_URL=http://localhost:5000