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 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: