-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
180 lines (170 loc) · 4.39 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
180 lines (170 loc) · 4.39 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
services:
# ==================== Infrastructure ====================
neo4j:
image: neo4j:5.15
container_name: ckg-neo4j
ports:
- "7474:7474"
- "7687:7687"
environment:
- NEO4J_AUTH=neo4j/${NEO4J_PASSWORD:-neo4j123456}
- NEO4J_dbms_memory_heap_initial__size=1G
- NEO4J_dbms_memory_heap_max__size=2G
- NEO4J_dbms_memory_pagecache_size=1G
- NEO4J_dbms_security_procedures_unrestricted=apoc.*
- NEO4J_dbms_security_allow__csv__import__from__file__urls=true
- TZ=UTC
volumes:
- neo4j_data:/data
- neo4j_logs:/logs
- ./docker/neo4j/init:/var/lib/neo4j/init
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:7474 || exit 1"]
interval: 30s
timeout: 10s
retries: 5
deploy:
resources:
limits:
cpus: '2'
memory: 4G
networks:
- ckg-network
restart: unless-stopped
postgres:
image: postgres:15
container_name: ckg-postgres
ports:
- "5432:5432"
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- POSTGRES_DB=ckg
- TZ=UTC
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 30s
timeout: 10s
retries: 5
deploy:
resources:
limits:
cpus: '1'
memory: 1G
networks:
- ckg-network
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: ckg-redis
ports:
- "6379:6379"
command: redis-server --appendonly yes
environment:
- TZ=UTC
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 5
deploy:
resources:
limits:
cpus: '1'
memory: 512M
networks:
- ckg-network
restart: unless-stopped
# ==================== Application ====================
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: ckg-backend
ports:
- "8080:8080"
dns:
- 8.8.8.8
- 8.8.4.4
extra_hosts:
- "github.com:20.205.243.166"
environment:
- SPRING_PROFILES_ACTIVE=prod
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/ckg?stringtype=unspecified
- SPRING_DATASOURCE_USERNAME=${POSTGRES_USER:-postgres}
- SPRING_DATASOURCE_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- SPRING_NEO4J_URI=bolt://neo4j:7687
- SPRING_NEO4J_AUTHENTICATION_USERNAME=neo4j
- SPRING_NEO4J_AUTHENTICATION_PASSWORD=${NEO4J_PASSWORD:-neo4j123456}
- SPRING_DATA_REDIS_HOST=redis
- SPRING_DATA_REDIS_PORT=6379
- LLM_PROVIDER=${LLM_PROVIDER:-openai}
- LLM_API_KEY=${LLM_API_KEY:?LLM_API_KEY must be set in .env}
- LLM_MODEL=${LLM_MODEL:-gpt-4o}
- LLM_BASE_URL=${LLM_BASE_URL:-https://api.openai.com/v1}
- JWT_SECRET=${JWT_SECRET:?JWT_SECRET must be set in .env}
- GIT_REPOS_PATH=/data/repos
volumes:
- repos_data:/data/repos
- ${HOST_PROJECTS_DIR:-./host-projects}:/host-projects:ro
depends_on:
neo4j:
condition: service_healthy
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
interval: 30s
timeout: 10s
retries: 5
deploy:
resources:
limits:
cpus: '2'
memory: 2G
networks:
- ckg-network
restart: unless-stopped
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- VITE_API_BASE_URL=/api
container_name: ckg-frontend
ports:
- "80:80"
depends_on:
- backend
deploy:
resources:
limits:
cpus: '1'
memory: 256M
networks:
- ckg-network
restart: unless-stopped
# ==================== Optional: Codegraph MCP ====================
# codegraph:
# image: ghcr.io/example/codegraph:latest
# container_name: ckg-codegraph
# volumes:
# - repos_data:/repos
# networks:
# - ckg-network
# restart: unless-stopped
volumes:
neo4j_data:
neo4j_logs:
postgres_data:
redis_data:
repos_data:
networks:
ckg-network:
driver: bridge