-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
180 lines (158 loc) · 6.04 KB
/
docker-compose.yml
File metadata and controls
180 lines (158 loc) · 6.04 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
# Giulia Docker Compose Configuration — Monitor/Worker Architecture
#
# Two containers from the same image:
# giulia-worker (port 4000) — does heavy work (scans, graphs, embeddings)
# giulia-monitor (port 4001) — watches worker via distributed Erlang
#
# Usage:
# docker compose up -d # Start both containers
# docker compose up -d giulia-worker # Start worker only (standalone)
# docker compose logs -f giulia-monitor # Watch monitor logs
# docker compose down # Stop all
#
# Single-container (backward compatible):
# docker compose up -d giulia-worker # Same as old giulia-daemon
x-common-env: &common-env
GIULIA_HOME: /data
GIULIA_IN_CONTAINER: "true"
GIULIA_COOKIE: ${GIULIA_COOKIE:-giulia_dev}
MIX_ENV: dev
MIX_BUILD_PATH: /tmp/giulia_build
MIX_DEPS_PATH: /tmp/giulia_deps
XLA_TARGET: cpu
GIULIA_HOST_PROJECTS_PATH: ${GIULIA_HOST_PROJECTS_PATH:-D:/Development/GitHub}
GIULIA_HOST_HOME: ${GIULIA_HOST_HOME:-}
GIULIA_PATH_MAPPING: ${GIULIA_PATH_MAPPING:-}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
GROQ_API_KEY: ${GROQ_API_KEY:-}
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
LM_STUDIO_URL: ${LM_STUDIO_URL:-http://host.docker.internal:1234/v1/chat/completions}
GIULIA_MCP_KEY: ${GIULIA_MCP_KEY:-glx-82010801fe7137408bf9ebb3de1f8a348706f0f237e4c016}
x-common-volumes: &common-volumes
- giulia_data:/data
- giulia_build:/tmp/giulia_build
- giulia_deps:/tmp/giulia_deps
- giulia_models:/root/.cache
- ${GIULIA_PROJECTS_PATH:-D:/Development/GitHub}:/projects:rw
- ${GIULIA_WORKSPACE_PATH:-./workspace}:/workspace:rw
x-common-deploy: &common-deploy
resources:
limits:
memory: 4G
reservations:
memory: 1G
x-common-logging: &common-logging
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
services:
# ============================================================================
# Worker — does heavy static analysis work (scans projectX, builds graphs)
# This is the main Giulia daemon. Equivalent to the old giulia-daemon service.
# ============================================================================
giulia-worker:
image: giulia/core:latest
build:
context: .
dockerfile: Dockerfile
container_name: giulia-worker
hostname: giulia-worker
restart: unless-stopped
command: >-
/bin/sh -c "cd /app && mix deps.get &&
elixir --name ${GIULIA_WORKER_NODE_NAME:-worker}@giulia-worker
--cookie ${GIULIA_COOKIE:-giulia_dev}
--erl '-kernel inet_dist_listen_min 9100 inet_dist_listen_max 9105'
-S mix run --no-halt"
environment:
<<: *common-env
GIULIA_NODE_NAME: ${GIULIA_WORKER_NODE_NAME:-worker}@giulia-worker
GIULIA_ROLE: worker
GIULIA_PORT: "4000"
# ArcadeDB runs as an external standalone container, not managed by this compose file.
# Use host.docker.internal to reach it from inside the Giulia containers.
ARCADEDB_URL: ${ARCADEDB_URL:-http://host.docker.internal:2480}
volumes: *common-volumes
# HTTP API + Distributed Erlang ports
# 4000 = HTTP API, 4369 = EPMD, 9100-9105 = distribution port range
ports:
- "4000:4000"
- "4369:4369"
- "9100-9105:9100-9105"
deploy: *common-deploy
logging: *common-logging
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:4000/health"]
interval: 30s
timeout: 10s
start_period: 15s
retries: 3
# ============================================================================
# Monitor — watches the worker via distributed Erlang, analyzes Giulia herself
#
# Connects to worker automatically on startup (AutoConnect GenServer).
# Scans Giulia's own source code to build her Knowledge Graph.
# Detects worker activity bursts and captures high-frequency runtime snapshots.
# Fuses runtime data with static analysis for performance profiling.
#
# Skips heavy children (EmbeddingServing, Inference pools) to save ~200MB RAM.
# ============================================================================
giulia-monitor:
image: giulia/core:latest
container_name: giulia-monitor
hostname: giulia-monitor
restart: unless-stopped
depends_on:
giulia-worker:
condition: service_healthy
command: >-
/bin/sh -c "cd /app && mix deps.get &&
elixir --name ${GIULIA_MONITOR_NODE_NAME:-monitor}@giulia-monitor
--cookie ${GIULIA_COOKIE:-giulia_dev}
--erl '-kernel inet_dist_listen_min 9110 inet_dist_listen_max 9115'
-S mix run --no-halt"
environment:
<<: *common-env
GIULIA_NODE_NAME: ${GIULIA_MONITOR_NODE_NAME:-monitor}@giulia-monitor
GIULIA_ROLE: monitor
GIULIA_PORT: "4001"
# AutoConnect: target node to watch via distributed Erlang
GIULIA_CONNECT_NODE: ${GIULIA_CONNECT_NODE:-worker@giulia-worker}
volumes: *common-volumes
# EPMD host port note:
# 4370:4369 maps the monitor's EPMD to a different host port to avoid
# collision with the worker's 4369:4369 mapping. This only matters for
# host-side access (e.g., connecting from a BEAM on the Windows host).
# Container-to-container communication goes through Docker's internal
# network where both containers listen on 4369 in their own network
# namespace — no conflict there.
ports:
- "4001:4001"
- "4370:4369"
- "9110-9115:9110-9115"
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 512M
logging: *common-logging
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:4001/health"]
interval: 30s
timeout: 10s
start_period: 20s
retries: 3
# NOTE: ArcadeDB runs as an external standalone container (not managed here).
# Start it separately: docker run -d --name arcadedb -p 2480:2480 arcadedata/arcadedb:latest
# Worker reaches it via ARCADEDB_URL=http://host.docker.internal:2480
volumes:
giulia_data:
name: giulia_data
giulia_build:
name: giulia_build
giulia_deps:
name: giulia_deps
giulia_models:
name: giulia_models