Ctrl K
ComunidadGuías…

docker-compose.yml

Rama master · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
# ============================================================
# WACore - Docker Compose (desarrollo / producción single-node)
# ============================================================
services:
  wacore:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: wacore
    volumes:
      - wa_sessions:/data/sessions
      - ./src:/app/src
    ports:
      - "${HEALTH_PORT:-9877}:9877"
      - "${API_PORT:-9878}:9878"
    environment:
      - WA_INSTANCE_NAME=${WA_INSTANCE_NAME:-bot-dev}
      - HEALTH_PORT=${HEALTH_PORT:-9877}
      - API_PORT=${API_PORT:-9878}
      - LOG_LEVEL=${LOG_LEVEL:-debug}
      - SESSION_STORE=${SESSION_STORE:-postgres}
      - DATABASE_URL=postgres://wacore:wacore@postgres:5432/wacore
      - CONNECT_ON_STARTUP=${CONNECT_ON_STARTUP:-true}
      - QR_TIMEOUT=${QR_TIMEOUT:-60000}
      - WEBHOOK_URL=${WEBHOOK_URL:-}
      - WEBHOOK_SECRET=${WEBHOOK_SECRET:-}
      - WEBHOOK_EVENTS=${WEBHOOK_EVENTS:-message}
      - WEBHOOK_RETRY_COUNT=${WEBHOOK_RETRY_COUNT:-3}
      - WEBHOOK_RETRY_DELAY=${WEBHOOK_RETRY_DELAY:-5000}
      - API_KEY=${API_KEY:-}
      - NODE_ENV=${NODE_ENV:-development}
    depends_on:
      redis:
        condition: service_started
      postgres:
        condition: service_healthy
    restart: unless-stopped

  redis:
    image: redis:7-alpine
    container_name: wacore-redis
    volumes:
      - redis_data:/data
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 3s
      retries: 5

  webhook-sink:
    image: webhooksite/webhook:latest
    container_name: wacore-webhook-sink
    ports:
      - "9000:9000"
    restart: unless-stopped
    profiles:
      - dev
      - debug

  postgres:
    image: postgres:16-alpine
    container_name: wacore-postgres
    environment:
      POSTGRES_USER: wacore
      POSTGRES_PASSWORD: wacore
      POSTGRES_DB: wacore
    volumes:
      - pg_data:/var/lib/postgresql/data
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U wacore"]
      interval: 5s
      timeout: 3s
      retries: 5
    ports:
      - "5444:5432"

volumes:
  wa_sessions:
  redis_data:
  pg_data: