feat: WhatsApp Nucleo con Nuxt 4 + Baileys v7
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 6m46s
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 6m46s
Reemplazo completo de Evolution API por implementación directa con Baileys. Características: - Dashboard completo con Nuxt UI v4 - Soporte para múltiples instancias de WhatsApp - Conexión via QR code o pairing code - Persistencia de mensajes en PostgreSQL - API REST para integraciones externas - Webhooks con firma HMAC - SSE para actualizaciones en tiempo real - Autenticación con Authentik
This commit is contained in:
@@ -1,96 +1,75 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
evolution-postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: evolution-postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- POSTGRES_USER=evolution
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_DB=evolution
|
||||
volumes:
|
||||
- evolution_postgres:/var/lib/postgresql/data
|
||||
networks:
|
||||
- principal
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U evolution"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
evolution-api:
|
||||
image: atendai/evolution-api:latest
|
||||
container_name: evolution-api
|
||||
whatsapp-nucleo:
|
||||
build: .
|
||||
image: ${REG}/${REPO_OWNER}/${APP_NAME}:latest
|
||||
container_name: ${APP_NAME}
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
evolution-postgres:
|
||||
whatsapp-postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
# Configuración básica
|
||||
- SERVER_URL=https://${APP_DOMAIN}
|
||||
- AUTHENTICATION_TYPE=apikey
|
||||
- AUTHENTICATION_API_KEY=${EVOLUTION_API_KEY}
|
||||
- AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
|
||||
|
||||
# Base de datos PostgreSQL
|
||||
- DATABASE_ENABLED=true
|
||||
- DATABASE_PROVIDER=postgresql
|
||||
- DATABASE_CONNECTION_URI=postgresql://evolution:${POSTGRES_PASSWORD}@evolution-postgres:5432/evolution
|
||||
- DATABASE_SAVE_DATA_INSTANCE=true
|
||||
- DATABASE_SAVE_DATA_NEW_MESSAGE=true
|
||||
- DATABASE_SAVE_MESSAGE_UPDATE=true
|
||||
- DATABASE_SAVE_DATA_CONTACTS=true
|
||||
- DATABASE_SAVE_DATA_CHATS=true
|
||||
- DATABASE_SAVE_DATA_LABELS=true
|
||||
- DATABASE_SAVE_DATA_HISTORIC=true
|
||||
|
||||
# Redis deshabilitado
|
||||
- CACHE_REDIS_ENABLED=false
|
||||
|
||||
# Webhooks globales (deshabilitado por ahora)
|
||||
- WEBHOOK_GLOBAL_ENABLED=false
|
||||
|
||||
# Integraciones (deshabilitadas)
|
||||
- CHATWOOT_ENABLED=false
|
||||
- TYPEBOT_ENABLED=false
|
||||
|
||||
volumes:
|
||||
- evolution_instances:/evolution/instances
|
||||
- evolution_store:/evolution/store
|
||||
- NODE_ENV=production
|
||||
- NUXT_HOST=0.0.0.0
|
||||
- NUXT_PORT=3000
|
||||
- DATABASE_URL=postgresql://whatsapp:${POSTGRES_PASSWORD}@${APP_NAME}-postgres:5432/whatsapp
|
||||
- NUXT_PUBLIC_AUTHENTIK_URL=https://authentik.nucleoriofrio.com
|
||||
- MASTER_API_KEY=${MASTER_API_KEY}
|
||||
networks:
|
||||
- principal
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.docker.network=principal
|
||||
- traefik.http.services.evolution-api.loadbalancer.server.port=8080
|
||||
- traefik.http.services.${APP_NAME}.loadbalancer.server.port=3000
|
||||
|
||||
# Router: Manager UI protegido con Authentik (incluye rutas de callback)
|
||||
- traefik.http.routers.evolution-ui.rule=Host(`${APP_DOMAIN}`) && (PathPrefix(`/manager`) || PathPrefix(`/outpost.goauthentik.io`))
|
||||
- traefik.http.routers.evolution-ui.entrypoints=websecure
|
||||
- traefik.http.routers.evolution-ui.tls.certresolver=letsencrypt
|
||||
- traefik.http.routers.evolution-ui.service=evolution-api
|
||||
- traefik.http.routers.evolution-ui.middlewares=authentik-forward-auth@file,evolution-headers
|
||||
- traefik.http.routers.evolution-ui.priority=100
|
||||
# Router: Recursos publicos (assets, manifest) - SIN autenticacion - ALTA PRIORIDAD
|
||||
- traefik.http.routers.${APP_NAME}-public.rule=Host(`${APP_DOMAIN}`) && (PathPrefix(`/manifest.webmanifest`) || PathPrefix(`/sw.js`) || PathPrefix(`/_nuxt/`) || PathPrefix(`/icons/`) || PathPrefix(`/favicon.ico`) || PathPrefix(`/api/health`))
|
||||
- traefik.http.routers.${APP_NAME}-public.entrypoints=websecure
|
||||
- traefik.http.routers.${APP_NAME}-public.tls.certresolver=letsencrypt
|
||||
- traefik.http.routers.${APP_NAME}-public.service=${APP_NAME}
|
||||
- traefik.http.routers.${APP_NAME}-public.priority=100
|
||||
- traefik.http.routers.${APP_NAME}-public.middlewares=${APP_NAME}-headers
|
||||
|
||||
# Router: API endpoints (autenticación por API Key, sin Authentik)
|
||||
- traefik.http.routers.evolution-api.rule=Host(`${APP_DOMAIN}`) && !PathPrefix(`/outpost.goauthentik.io`) && !PathPrefix(`/manager`)
|
||||
- traefik.http.routers.evolution-api.entrypoints=websecure
|
||||
- traefik.http.routers.evolution-api.tls.certresolver=letsencrypt
|
||||
- traefik.http.routers.evolution-api.service=evolution-api
|
||||
- traefik.http.routers.evolution-api.middlewares=evolution-headers
|
||||
- traefik.http.routers.evolution-api.priority=10
|
||||
# Router: API externa (usa API Key, sin Authentik) - MEDIA PRIORIDAD
|
||||
- traefik.http.routers.${APP_NAME}-api.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/api/messages/send`)
|
||||
- traefik.http.routers.${APP_NAME}-api.entrypoints=websecure
|
||||
- traefik.http.routers.${APP_NAME}-api.tls.certresolver=letsencrypt
|
||||
- traefik.http.routers.${APP_NAME}-api.service=${APP_NAME}
|
||||
- traefik.http.routers.${APP_NAME}-api.priority=50
|
||||
- traefik.http.routers.${APP_NAME}-api.middlewares=${APP_NAME}-headers
|
||||
|
||||
# Router: Principal (con Authentik) - BAJA PRIORIDAD
|
||||
- traefik.http.routers.${APP_NAME}.rule=Host(`${APP_DOMAIN}`)
|
||||
- traefik.http.routers.${APP_NAME}.entrypoints=websecure
|
||||
- traefik.http.routers.${APP_NAME}.tls.certresolver=letsencrypt
|
||||
- traefik.http.routers.${APP_NAME}.service=${APP_NAME}
|
||||
- traefik.http.routers.${APP_NAME}.priority=10
|
||||
- traefik.http.routers.${APP_NAME}.middlewares=authentik-forward-auth@file,${APP_NAME}-headers
|
||||
|
||||
# Middleware: Headers
|
||||
- traefik.http.middlewares.evolution-headers.headers.customrequestheaders.X-Forwarded-Proto=https
|
||||
- traefik.http.middlewares.${APP_NAME}-headers.headers.customrequestheaders.X-Forwarded-Proto=https
|
||||
|
||||
whatsapp-postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: ${APP_NAME}-postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- POSTGRES_USER=whatsapp
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_DB=whatsapp
|
||||
volumes:
|
||||
- whatsapp_postgres:/var/lib/postgresql/data
|
||||
- ./server/database/init:/docker-entrypoint-initdb.d:ro
|
||||
networks:
|
||||
- principal
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U whatsapp -d whatsapp"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
evolution_instances:
|
||||
name: evolution_instances
|
||||
evolution_store:
|
||||
name: evolution_store
|
||||
evolution_postgres:
|
||||
name: evolution_postgres
|
||||
whatsapp_postgres:
|
||||
name: ${APP_NAME}_postgres
|
||||
|
||||
networks:
|
||||
principal:
|
||||
|
||||
Reference in New Issue
Block a user