diff --git a/.github/workflows/gcp-deploy.yml b/.github/workflows/gcp-deploy.yml index 4aaccce..a5f1388 100644 --- a/.github/workflows/gcp-deploy.yml +++ b/.github/workflows/gcp-deploy.yml @@ -6,6 +6,25 @@ on: - main env: +env: + # Transport Service + TRANSPORT_SERVICE_DATABASE_URL: ${{ secrets.TRANSPORT_SERVICE_DATABASE_URL }} + TRANSPORT_SERVICE_PORT: 8080 + TRANSPORT_SERVICE_LOG_LEVEL: INFO + + # Translation Service + TRANSLATION_SERVICE_DATABASE_URL: ${{ secrets.TRANSLATION_SERVICE_DATABASE_URL }} + TRANSLATION_SERVICE_PORT: 8080 + TRANSLATION_SERVICE_LOG_LEVEL: INFO + TRANSLATION_SERVICE_SUPPORTED_LANGUAGES: '{"en":"English","ru":"Русский","uk":"Українська","de":"Deutsch","fr":"Français","es":"Español","it":"Italiano"}' + + # Telegram Bot Service + TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} + TRANSPORT_SERVICE_URL: ${{ secrets.TRANSPORT_SERVICE_URL }} + TELEGRAM_BOT_DATABASE_URL: ${{ secrets.TELEGRAM_BOT_DATABASE_URL }} + TELEGRAM_BOT_SUPPORTED_LANGUAGES: '{"en":"English","ru":"Русский","uk":"Українська","de":"Deutsch","fr":"Français","es":"Español","it":"Italiano"}' + TELEGRAM_BOT_LOG_LEVEL: INFO + GCP_REGION: ${{ secrets.GCP_REGION }} PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} GKE_CLUSTER: ${{ secrets.GKE_CLUSTER_NAME }} diff --git a/translation_service/config.py b/translation_service/config.py new file mode 100644 index 0000000..4131578 --- /dev/null +++ b/translation_service/config.py @@ -0,0 +1,22 @@ +import os +from dotenv import load_dotenv + +load_dotenv() + +# Базовые настройки сервиса перевода +DATABASE_URL = os.getenv('TRANSLATION_SERVICE_DATABASE_URL') +SERVICE_PORT = int(os.getenv('TRANSLATION_SERVICE_PORT', 8080)) + +# Поддерживаемые языки +SUPPORTED_LANGUAGES = { + 'en': 'English', + 'ru': 'Русский', + 'uk': 'Українська', + 'de': 'Deutsch', + 'fr': 'Français', + 'es': 'Español', + 'it': 'Italiano' +} + +# Настройки логирования +LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO') \ No newline at end of file diff --git a/transport_service/config.py b/transport_service/config.py new file mode 100644 index 0000000..61c21ce --- /dev/null +++ b/transport_service/config.py @@ -0,0 +1,13 @@ +import os +from dotenv import load_dotenv + +load_dotenv() + +# Базовые настройки сервиса транспорта +DATABASE_URL = os.getenv('TRANSPORT_SERVICE_DATABASE_URL') +SERVICE_PORT = int(os.getenv('TRANSPORT_SERVICE_PORT', 8080)) + +# Настройки логирования +LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO') + +# Другие параметры конфигурации при необходимости \ No newline at end of file diff --git a/transport_service/main.py b/transport_service/main.py index a6bca40..d46ac10 100644 --- a/transport_service/main.py +++ b/transport_service/main.py @@ -22,7 +22,7 @@ async def route_request(request: ServiceRequest): request_counter.inc() service_endpoints = { - "translation": "http://translation-service:8000", + "translation": "http://translation-service:8080", "telegram": "http://telegram-bot-service:8080" } diff --git a/transport_service/requirements.txt b/transport_service/requirements.txt index e0f814b..5171fef 100644 --- a/transport_service/requirements.txt +++ b/transport_service/requirements.txt @@ -4,4 +4,5 @@ httpx==0.19.0 prometheus-client==0.11.0 pydantic==1.8.2 pytest -pytest-cov \ No newline at end of file +pytest-cov +python-dotenv \ No newline at end of file