-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.live-e2e.yml
More file actions
141 lines (134 loc) · 4.2 KB
/
Copy pathdocker-compose.live-e2e.yml
File metadata and controls
141 lines (134 loc) · 4.2 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
134
135
136
137
138
139
140
141
services:
db:
image: pgvector/pgvector:pg16
environment:
POSTGRES_DB: ai_email_live
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD for live E2E}
POSTGRES_INITDB_ARGS: "--auth-local=scram-sha-256 --auth-host=scram-sha-256"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U \"$${POSTGRES_USER}\" -d \"$${POSTGRES_DB}\""]
interval: 5s
timeout: 5s
retries: 20
volumes:
- live-postgres-data:/var/lib/postgresql/data
ollama:
build:
context: .
dockerfile: Dockerfile.ollama
environment:
OLLAMA_NO_CLOUD: "true"
expose:
- "11434"
migrate:
image: ${BACKEND_IMAGE:?Set BACKEND_IMAGE to a pre-built backend image}
environment:
DATABASE_URL: ${DATABASE_URL:?Set DATABASE_URL for live E2E}
ENCRYPTION_KEY: ${ENCRYPTION_KEY:?Set ENCRYPTION_KEY for live E2E}
AUTH_SESSION_HMAC_SECRET: ${AUTH_SESSION_HMAC_SECRET:?Set AUTH_SESSION_HMAC_SECRET for live E2E}
TRUST_DEV_HEADERS: "false"
DEBUG: "false"
OPENAI_API_KEY: ""
depends_on:
db:
condition: service_healthy
volumes:
- live-e2e-state:/live-e2e-state
command:
- sh
- -c
- |
rm -f /live-e2e-state/migrated /live-e2e-state/seeded
python scripts/bootstrap_db.py
touch /live-e2e-state/migrated
live-seed:
image: ${BACKEND_IMAGE:?Set BACKEND_IMAGE to a pre-built backend image}
environment:
DATABASE_URL: ${DATABASE_URL:?Set DATABASE_URL for live E2E}
ENCRYPTION_KEY: ${ENCRYPTION_KEY:?Set ENCRYPTION_KEY for live E2E}
AUTH_SESSION_HMAC_SECRET: ${AUTH_SESSION_HMAC_SECRET:?Set AUTH_SESSION_HMAC_SECRET for live E2E}
TRUST_DEV_HEADERS: "false"
DEBUG: "false"
OPENAI_API_KEY: ""
depends_on:
migrate:
condition: service_completed_successfully
volumes:
- live-e2e-state:/live-e2e-state
command:
- sh
- -c
- |
marker=/live-e2e-state/migrated
for attempt in $(seq 1 120); do
[ -f "$$marker" ] && break
sleep 1
done
if [ ! -f "$$marker" ]; then
echo "Required startup marker missing: $$marker" >&2
exit 1
fi
python tests/live/seed_live_data.py
touch /live-e2e-state/seeded
backend:
image: ${BACKEND_IMAGE:?Set BACKEND_IMAGE to a pre-built backend image}
environment:
DATABASE_URL: ${DATABASE_URL:?Set DATABASE_URL for live E2E}
ENCRYPTION_KEY: ${ENCRYPTION_KEY:?Set ENCRYPTION_KEY for live E2E}
AUTH_SESSION_HMAC_SECRET: ${AUTH_SESSION_HMAC_SECRET:?Set AUTH_SESSION_HMAC_SECRET for live E2E}
TRUST_DEV_HEADERS: "false"
DEBUG: "false"
ALLOW_LOCAL_LLM_PROVIDERS: "true"
ALLOWED_CORS_ORIGINS: http://127.0.0.1:18080
ALLOWED_LLM_BASE_URL_HOSTS: "ollama"
OPENAI_API_KEY: ollama
OPENAI_BASE_URL: http://ollama:11434/v1
OPENAI_EMBEDDING_MODEL: embeddinggemma
OPENAI_MODEL: gemma4:e2b-it-qat
depends_on:
live-seed:
condition: service_completed_successfully
ollama:
condition: service_started
volumes:
- live-e2e-state:/live-e2e-state
expose:
- "8000"
command:
- sh
- -c
- |
marker=/live-e2e-state/seeded
for attempt in $(seq 1 120); do
[ -f "$$marker" ] && break
sleep 1
done
if [ ! -f "$$marker" ]; then
echo "Required startup marker missing: $$marker" >&2
exit 1
fi
exec python scripts/start_backend.py --host 0.0.0.0 --port 8000
frontend:
image: ${FRONTEND_IMAGE:?Set FRONTEND_IMAGE to a pre-built frontend image}
environment:
BACKEND_INTERNAL_URL: http://backend:8000
ALLOW_DOCKER_BACKEND_INTERNAL_URL: "1"
TRUSTED_FRONTEND_ORIGINS: http://127.0.0.1:18080
depends_on:
- backend
expose:
- "3000"
nginx:
image: nginx:1.27-alpine
command: ["nginx", "-g", "daemon off; error_log /dev/stderr warn;"]
depends_on:
- backend
- frontend
ports:
- "127.0.0.1:18080:8080"
volumes:
- ./tests/live/nginx.conf:/etc/nginx/conf.d/default.conf:ro
volumes:
live-postgres-data:
live-e2e-state: