Sistema NEXUS v3.4 migrado con: Estructura principal: - core/orchestration: Sistema SIMCO + CAPVED (27 directivas, 28 perfiles) - core/catalog: Catalogo de funcionalidades reutilizables - shared/knowledge-base: Base de conocimiento compartida - devtools/scripts: Herramientas de desarrollo - control-plane/registries: Control de servicios y CI/CD - orchestration/: Configuracion de orquestacion de agentes Proyectos incluidos (11): - gamilit (submodule -> GitHub) - trading-platform (OrbiquanTIA) - erp-suite con 5 verticales: - erp-core, construccion, vidrio-templado - mecanicas-diesel, retail, clinicas - betting-analytics - inmobiliaria-analytics - platform_marketing_content - pos-micro, erp-basico Configuracion: - .gitignore completo para Node.js/Python/Docker - gamilit como submodule (git@github.com:rckrdmrd/gamilit-workspace.git) - Sistema de puertos estandarizado (3005-3199) Generated with NEXUS v3.4 Migration System EPIC-010: Configuracion Git y Repositorios
101 lines
2.9 KiB
YAML
101 lines
2.9 KiB
YAML
# ==============================================================================
|
|
# DOCKER COMPOSE TEMPLATE - BACKEND SERVICE
|
|
# ==============================================================================
|
|
# Template para servicios backend (Node.js, Python, etc.)
|
|
#
|
|
# USO:
|
|
# 1. Copiar a tu proyecto: cp template proyecto/docker/docker-compose.yml
|
|
# 2. Reemplazar placeholders:
|
|
# - {{SERVICE_NAME}} -> nombre del servicio (ej: gamilit-api)
|
|
# - {{PORT}} -> puerto interno (ej: 3000)
|
|
# - {{DOMAIN}} -> dominio Traefik (ej: api.gamilit.localhost)
|
|
# - {{PROJECT}} -> nombre del proyecto (ej: gamilit)
|
|
# 3. Ajustar segun necesidades
|
|
#
|
|
# REGLAS:
|
|
# - Usar expose, NO ports
|
|
# - Redes deben ser external: true
|
|
# - Incluir labels de Traefik
|
|
# - Incluir healthcheck
|
|
# ==============================================================================
|
|
|
|
version: "3.8"
|
|
|
|
# Anchors reutilizables
|
|
x-logging: &default-logging
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
x-healthcheck: &default-healthcheck
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
services:
|
|
# ==========================================================================
|
|
# BACKEND SERVICE
|
|
# ==========================================================================
|
|
{{SERVICE_NAME}}:
|
|
build:
|
|
context: ../apps/backend
|
|
dockerfile: Dockerfile
|
|
args:
|
|
- NODE_ENV=${NODE_ENV:-development}
|
|
container_name: {{SERVICE_NAME}}
|
|
restart: unless-stopped
|
|
|
|
# IMPORTANTE: usar expose, NO ports
|
|
expose:
|
|
- "{{PORT}}"
|
|
|
|
# Variables de entorno
|
|
environment:
|
|
- NODE_ENV=${NODE_ENV:-development}
|
|
- PORT={{PORT}}
|
|
- DATABASE_URL=${DATABASE_URL}
|
|
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
|
|
- JWT_SECRET=${JWT_SECRET}
|
|
- JWT_EXPIRES_IN=${JWT_EXPIRES_IN:-1d}
|
|
- LOG_LEVEL=${LOG_LEVEL:-info}
|
|
|
|
# Health check
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:{{PORT}}/health"]
|
|
<<: *default-healthcheck
|
|
|
|
# Labels para Traefik
|
|
labels:
|
|
- "traefik.enable=true"
|
|
# Router
|
|
- "traefik.http.routers.{{SERVICE_NAME}}.rule=Host(`{{DOMAIN}}`)"
|
|
- "traefik.http.routers.{{SERVICE_NAME}}.entrypoints=web"
|
|
# Service
|
|
- "traefik.http.services.{{SERVICE_NAME}}.loadbalancer.server.port={{PORT}}"
|
|
# Middlewares (opcional)
|
|
# - "traefik.http.routers.{{SERVICE_NAME}}.middlewares=api-chain@file"
|
|
|
|
# Redes
|
|
networks:
|
|
- {{PROJECT}}_${ENV:-local}
|
|
- infra_shared
|
|
|
|
# Logging
|
|
logging:
|
|
<<: *default-logging
|
|
|
|
# Volumenes para desarrollo (opcional)
|
|
# volumes:
|
|
# - ../apps/backend/src:/app/src:ro
|
|
|
|
# ==============================================================================
|
|
# NETWORKS
|
|
# ==============================================================================
|
|
networks:
|
|
{{PROJECT}}_${ENV:-local}:
|
|
external: true
|
|
infra_shared:
|
|
external: true
|