-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
128 lines (122 loc) · 3.76 KB
/
docker-compose.yml
File metadata and controls
128 lines (122 loc) · 3.76 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
services:
postgres:
image: ghcr.io/mayflower/pg4ai:latest
platform: ${POSTGRES_PLATFORM:-linux/amd64}
ports:
- "5433:5432"
environment:
POSTGRES_USER: contextmine
POSTGRES_PASSWORD: contextmine
POSTGRES_DB: contextmine
volumes:
- postgres_data:/var/lib/postgresql/data
- ./scripts/docker/init-db.sql:/docker-entrypoint-initdb.d/10-init-db.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U contextmine -d contextmine"]
interval: 5s
timeout: 5s
retries: 5
api:
build:
context: .
dockerfile: apps/api/Dockerfile
ports:
- "8111:8000"
env_file:
- .env
environment:
# Override DATABASE_URL for Docker network
- DATABASE_URL=postgresql+asyncpg://contextmine:contextmine@postgres:5432/contextmine
volumes:
# Mount source for development hot reload
- ./packages:/app/packages:ro
- ./apps/api:/app/apps/api:ro
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
codecharta:
image: codecharta/codecharta-visualization:latest
ports:
- "9001:80"
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost/"]
interval: 10s
timeout: 5s
retries: 5
# Prefect stack
prefect-server:
image: prefecthq/prefect:3-python3.12
command: prefect server start --host 0.0.0.0
ports:
- "4200:4200"
environment:
PREFECT_SERVER_API_HOST: 0.0.0.0
PREFECT_UI_API_URL: http://localhost:4200/api
PREFECT_API_DATABASE_CONNECTION_URL: postgresql+asyncpg://contextmine:contextmine@postgres:5432/prefect
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:4200/api/health')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
worker:
platform: linux/amd64
build:
context: .
dockerfile: apps/worker/Dockerfile
env_file:
- .env
environment:
# Override for Docker network
DATABASE_URL: postgresql+asyncpg://contextmine:contextmine@postgres:5432/contextmine
PREFECT_API_URL: http://prefect-server:4200/api
# Disable subprocess isolation to prevent zombie processes from OTEL threads
PREFECT_RUNNER_PROCESS_ISOLATION: "0"
volumes:
# Mount source for development hot reload
- ./packages:/app/packages:ro
- ./apps/worker:/app/apps/worker:ro
# Persistent data for repos and crawl cache
- worker_data:/data
# Build tool caches for faster SCIP indexing
- npm_cache:/home/appuser/.npm
- maven_cache:/home/appuser/.m2
- gradle_cache:/home/appuser/.gradle
- composer_cache:/home/appuser/.composer/cache
depends_on:
postgres:
condition: service_healthy
prefect-server:
condition: service_healthy
# Optional: OpenTelemetry Collector for local development
# Start with: docker compose --profile otel up
otel-collector:
image: otel/opentelemetry-collector-contrib:latest
profiles: ["otel"]
ports:
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
- "55679:55679" # zpages (debugging)
volumes:
- ./scripts/docker/otel/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml:ro
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:13133/"]
interval: 10s
timeout: 5s
retries: 3
volumes:
postgres_data:
worker_data:
npm_cache:
maven_cache:
gradle_cache:
composer_cache: