-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
133 lines (123 loc) · 4.44 KB
/
docker-compose.yml
File metadata and controls
133 lines (123 loc) · 4.44 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
services:
web:
build:
context: .
dockerfile: Dockerfile
args:
# Build-time env for Next.js (baked into the client code)
DATABASE_URL: "COMING SOON"
NEXTAUTH_URL: "http://localhost:3000"
NEXTAUTH_SECRET: "your-secret-key-here"
# IMPORTANT: Use `n8n:5678` so the web container can talk to n8n
NEXT_PUBLIC_AGENT_API_URL: "http://n8n:5678"
NEXT_PUBLIC_AGENT_API_KEY: "your_n8n_key_here"
NEXT_PUBLIC_N8N_DEFAULT_WORKFLOW: "/webhook/dataengineering-common"
NEXT_PUBLIC_N8N_OPENAI_WORKFLOW: "/webhook/dataengineering-common"
NEXT_PUBLIC_N8N_OLLAMA_WORKFLOW: "/webhook/dataengineering-common"
NEXT_PUBLIC_N8N_CLAUDE_WORKFLOW: "/webhook/dataengineering-common"
NEXT_PUBLIC_N8N_GEMINI_WORKFLOW: "/webhook/dataengineering-common"
# IMPORTANT: Use your own key, you can use the .env file to set this
# CRITICAL: You can run it without keys by using Ollama
NEXT_PUBLIC_OPENAI_API_KEY: ${NEXT_PUBLIC_OPENAI_API_KEY}
NEXT_PUBLIC_ANTHROPIC_API_KEY: ${NEXT_PUBLIC_ANTHROPIC_API_KEY}
NEXT_PUBLIC_GEMINI_API_KEY: ${NEXT_PUBLIC_GEMINI_API_KEY}
# CRITICAL FIX: Use container name instead of localhost
NEXT_PUBLIC_OLLAMA_API_URL: "http://ollama:11434"
ports:
- "3000:3000"
environment:
# Runtime environment for your server code (and optional duplication of client vars)
NODE_ENV: production
DATABASE_URL: "postgresql://postgres:postgres@db:5432/data_agents_db"
NEXTAUTH_URL: "http://localhost:3000"
NEXTAUTH_SECRET: "your-secret-key-here"
# CRITICAL FIX: Use consistent URLs for all services
NEXT_PUBLIC_AGENT_API_URL: "http://n8n:5678"
NEXT_PUBLIC_AGENT_API_KEY: "your_n8n_key_here"
NEXT_PUBLIC_N8N_DEFAULT_WORKFLOW: "/webhook/dataengineering-common"
NEXT_PUBLIC_N8N_OPENAI_WORKFLOW: "/webhook/dataengineering-common"
NEXT_PUBLIC_N8N_OLLAMA_WORKFLOW: "/webhook/dataengineering-common"
NEXT_PUBLIC_N8N_CLAUDE_WORKFLOW: "/webhook/dataengineering-common"
NEXT_PUBLIC_N8N_GEMINI_WORKFLOW: "/webhook/dataengineering-common"
NEXT_PUBLIC_OPENAI_API_KEY: ${NEXT_PUBLIC_OPENAI_API_KEY}
NEXT_PUBLIC_ANTHROPIC_API_KEY: ${NEXT_PUBLIC_ANTHROPIC_API_KEY}
NEXT_PUBLIC_GEMINI_API_KEY: ${NEXT_PUBLIC_GEMINI_API_KEY}
# CRITICAL FIX: Use container name instead of localhost
NEXT_PUBLIC_OLLAMA_API_URL: "http://ollama:11434"
volumes:
- ./data:/app/data
depends_on:
- n8n
- ollama
- db
restart: unless-stopped
networks:
- data-engineering-network
healthcheck:
test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/healthz" ]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
n8n:
image: docker.n8n.io/n8nio/n8n
ports:
- "5678:5678"
environment:
# By binding to 0.0.0.0, n8n is reachable from the 'web' container.
- N8N_HOST=0.0.0.0
- N8N_PORT=5678
- N8N_PROTOCOL=http
- NODE_ENV=production
- N8N_LOG_LEVEL=info
# Pass API keys to n8n
- NEXT_PUBLIC_GEMINI_API_KEY=${NEXT_PUBLIC_GEMINI_API_KEY}
volumes:
- n8n_data:/home/node/.n8n
# Add the volume mount for avatar definitions
- ./data/avatars:/data/avatars
restart: unless-stopped
networks:
- data-engineering-network
healthcheck:
# "localhost" inside the n8n container is fine for the n8n process itself
test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:5678/healthz" ]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
# CRITICAL ADDITION: Add the Ollama container
ollama:
image: ollama/ollama:latest
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
networks:
- data-engineering-network
restart: unless-stopped
# Add database for completeness
db:
image: postgres:14-alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=data_agents_db
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- data-engineering-network
restart: unless-stopped
volumes:
n8n_data:
name: n8n_data
# New volumes for the added services
ollama_data:
name: ollama_data
postgres_data:
name: postgres_data
networks:
data-engineering-network:
driver: bridge