File size: 2,165 Bytes
c8b040b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
services:
  n8n:
    # UPDATED: Use a recent, stable version of n8n
    image: n8nio/n8n:1.108.0
    container_name: N8N-Infrastructure
    restart: unless-stopped
    env_file:
      - ./config/.env
    ports:
      # The host port (left) can be changed; container port remains n8n's default (5678)
      - "${N8N_PORT_LOCAL:-5678}:5678"
    environment:
      # --- Database Settings ---
      # All sensitive DB credentials (HOST, DB, USER, PASS) should be in .env
      - DB_POSTGRESDB_SSL=${DB_POSTGRESDB_SSL:-true}
      # Align with Supabase pooler default (6543) unless overridden
      - DB_POSTGRESDB_PORT=${DB_POSTGRESDB_PORT:-6543}
      - DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED=${DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED:-false}

      # --- Community Nodes ---
      # FIXED: Correctly formatted as a comma-separated string
      - N8N_ENABLE_COMMUNITY_NODES=${N8N_ENABLE_COMMUNITY_NODES:-true}
      - N8N_COMMUNITY_PACKAGES=${N8N_COMMUNITY_PACKAGES:-n8n-nodes-langchain,n8n-nodes-google,n8n-nodes-vertexai}

      # --- n8n Core Settings ---
      # These are read from the .env file, with sane defaults for local dev.
      - N8N_HOST=${N8N_HOST:-localhost}
      - N8N_PORT=${N8N_PORT:-5678}
      - N8N_PROTOCOL=${N8N_PROTOCOL:-http}
      # FIXED: Webhook URL now dynamically points to the local instance
      - WEBHOOK_URL=${WEBHOOK_URL:-http://localhost:${N8N_PORT_LOCAL:-5678}}

    volumes:
      # Persists n8n data between restarts
      - n8n_data:/home/node/.n8n
      # Mount local directories for workflow and knowledge base development
      - ./workflows:/data/workflows:rw
      - ./knowledge:/data/knowledge:rw
    healthcheck:
      # Healthcheck now correctly points to the internal n8n port
      test: ["CMD", "curl", "-fsS", "http://localhost:5678/healthz"]
      interval: 30s
      timeout: 10s
      retries: 5

  # Optional vector DB for local development
  qdrant:
    # UPDATED: Use a recent, stable version of Qdrant
    image: qdrant/qdrant:v1.10.1
    container_name: qdrant
    restart: unless-stopped
    ports:
      - "6543:6543"
    volumes:
      - qdrant_data:/qdrant/storage

volumes:
  n8n_data:
  qdrant_data: