services:
  n8n:
    image: docker.n8n.io/n8nio/n8n:2.30.5
    container_name: n8n
    restart: unless-stopped
    ports:
      - "5678:5678"
    environment:
      TZ: UTC
      GENERIC_TIMEZONE: UTC
      N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS: "true"
      WEBHOOK_URL: https://n8n.example.com/
      N8N_EDITOR_BASE_URL: https://n8n.example.com/
      N8N_PROXY_HOPS: "1"
      EXECUTIONS_DATA_PRUNE: "true"
      EXECUTIONS_DATA_MAX_AGE: "2160"
      EXECUTIONS_DATA_PRUNE_MAX_COUNT: "10000"
      EXECUTIONS_TIMEOUT: "600"
      N8N_DIAGNOSTICS_ENABLED: "false"
      N8N_PERSONALIZATION_ENABLED: "false"
      N8N_BLOCK_ENV_ACCESS_IN_NODE: "true"
    volumes:
      - n8n_data:/home/node/.n8n
    healthcheck:
      test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:5678/healthz').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 30s

volumes:
  n8n_data:
    name: ai_lead_concierge_n8n_data
