-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
113 lines (107 loc) · 3.19 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
113 lines (107 loc) · 3.19 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
# --- L9_META ---
# l9_schema: 1
# origin: l9-template
# engine: graph
# layer: [docker]
# tags: [L9_TEMPLATE, docker, prod]
# owner: platform
# status: active
# --- /L9_META ---
#
# L9 Graph Cognitive Engine — Production Docker Compose
# Usage: docker compose -f docker-compose.prod.yml up -d
# Requires: NEO4J_PASSWORD and API_SECRET_KEY env vars set (no defaults in prod)
services:
# ── API Server (Production) ──────────────────────────────
api:
build:
context: .
dockerfile: Dockerfile.prod
container_name: l9-graph-api-prod
ports:
- "8000:8000"
environment:
L9_ENV: prod
L9_LIFECYCLE_HOOK: engine.boot:GraphLifecycle
NEO4J_URI: bolt://neo4j:7687
NEO4J_USERNAME: ${NEO4J_USERNAME:-neo4j}
NEO4J_PASSWORD: ${NEO4J_PASSWORD:?NEO4J_PASSWORD must be set for production}
NEO4J_POOL_SIZE: "50"
REDIS_URL: redis://redis:6379/0
API_SECRET_KEY: ${API_SECRET_KEY:?API_SECRET_KEY must be set for production}
LOG_LEVEL: info
CORS_ORIGINS: ${CORS_ORIGINS:-[]}
DOMAINS_ROOT: domains
KGE_ENABLED: "true"
KGE_CONFIDENCE_THRESHOLD: "0.3"
KGE_EMBEDDING_DIM: "300"
PARETO_ENABLED: "true"
depends_on:
neo4j:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/v1/health')"]
interval: 30s
timeout: 5s
retries: 3
restart: always
networks:
- l9-net
deploy:
resources:
limits:
cpus: '2'
memory: 2G
# ── Neo4j 5.x Enterprise + GDS ──────────────────────────
neo4j:
image: neo4j:5.15-enterprise
container_name: l9-neo4j-prod
ports:
- "7474:7474"
- "7687:7687"
environment:
NEO4J_AUTH: ${NEO4J_USERNAME:-neo4j}/${NEO4J_PASSWORD:?NEO4J_PASSWORD must be set}
NEO4J_ACCEPT_LICENSE_AGREEMENT: "yes"
NEO4J_PLUGINS: '["graph-data-science"]'
NEO4J_dbms_security_procedures_unrestricted: gds.*
NEO4J_dbms_security_procedures_allowlist: gds.*
NEO4J_dbms_memory_heap_initial__size: 1g
NEO4J_dbms_memory_heap_max__size: 2g
NEO4J_dbms_memory_pagecache_size: 1g
volumes:
- neo4j-data:/data
- neo4j-logs:/logs
networks:
- l9-net
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:7474 || exit 1"]
interval: 10s
timeout: 5s
retries: 10
restart: always
# ── Redis 7.x ───────────────────────────────────────────
redis:
image: redis:7-alpine
container_name: l9-redis-prod
ports:
- "6379:6379"
command: redis-server --maxmemory 256mb --maxmemory-policy allkeys-lru
volumes:
- redis-data:/data
networks:
- l9-net
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
restart: always
volumes:
neo4j-data:
neo4j-logs:
redis-data:
networks:
l9-net:
name: l9-net