English version | Русская версия
This architecture is designed for a microservice ecosystem where business logic is separated from infrastructure orchestration. The primary goal is to provide a unified environment for developing, testing, and deploying multiple services written in different languages (Go, Python, Node.js, etc.) using a single entry point.
- services/: The core directory containing all microservices.
- auth/, profile/, etc.: Each subdirectory is a standalone microservice.
- Dockerfile: Every service contains its own Dockerfile, ensuring environment isolation.
- __legacy/: Used for deprecated code or older versions during migration.
- shared/ (Optional): Directory for common code, helper functions, or configuration templates shared across multiple services.
- .gitignore: Global ignore rules for the entire services workspace.
- Polyglot Support: You can host services written in Go, Python, or any other language within the
services/directory. - Infrastructure-First: All services are launched and orchestrated via the -infra repository using Docker Compose.
- Local Development: In
devmode, services can be run individually or collectively, with the frontend typically launched separately. - Shared Resources: Support for common logic through shared directories that can be mounted or built into service containers.
The -infra repository interacts with this structure by defining build contexts. For example, in docker-compose.yml:
services:
auth:
build:
context: ../microservices-repo-name/services/microservice-name
dockerfile: DockerfileДанная архитектура разработана для экосистемы микросервисов, где бизнес-логика отделена от оркестрации инфраструктуры. Основная цель — предоставить единую среду для разработки, тестирования и развертывания нескольких сервисов на разных языках (Go, Python, Node.js и др.), используя единую точку входа.
- services/: Основная директория, содержащая все микросервисы.
- auth/, profile/ и др.: Каждый подкаталог является независимым микросервисом.
- Dockerfile: Каждый сервис содержит собственный Dockerfile, что обеспечивает изоляцию среды окружения.
- __legacy/: Используется для устаревшего кода или старых версий сервисов в процессе миграции.
- shared/ (Опционально): Директория для общего кода, вспомогательных функций или шаблонов конфигурации, используемых несколькими сервисами.
- .gitignore: Глобальные правила игнорирования для всего рабочего пространства сервисов.
- Полиглотная архитектура: Внутри директории
services/можно размещать сервисы на Go, Python или любых других языках. - Infrastructure-First: Все сервисы запускаются и управляются через репозиторий -infra с помощью Docker Compose.
- Локальная разработка: В режиме
devсервисы могут запускаться как по отдельности, так и совместно, при этом фронтенд обычно запускается отдельно. - Общие ресурсы: Поддержка общей логики через shared-директории, которые могут монтироваться или копироваться в контейнеры сервисов при сборке.
Репозиторий -infra взаимодействует с этой структурой через определение контекстов сборки. Пример в docker-compose.yml:
services:
auth:
build:
context: ../название-репо-с-микросервисами/services/название-микросервиса
dockerfile: Dockerfile