-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.quickstart.yml
More file actions
201 lines (193 loc) · 6.78 KB
/
Copy pathdocker-compose.quickstart.yml
File metadata and controls
201 lines (193 loc) · 6.78 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
services:
postgres:
image: timescale/timescaledb:2.28.2-pg15
environment:
POSTGRES_DB: humanly_dev
POSTGRES_USER: humanly_user
POSTGRES_PASSWORD: humanly_password
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- quickstart_postgres_data:/var/lib/postgresql/data
healthcheck:
# Timescale starts a temporary server during first-run tuning. Wait for
# the final PostgreSQL process so migrations cannot race its restart.
test: ["CMD-SHELL", "test \"$$(cat /proc/1/comm)\" = postgres && pg_isready -U humanly_user -d humanly_dev"]
interval: 10s
timeout: 5s
retries: 10
restart: unless-stopped
redis:
image: redis:7-alpine
command: redis-server --appendonly yes
volumes:
- quickstart_redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10
restart: unless-stopped
quickstart-migrate:
image: timescale/timescaledb:2.28.2-pg15
environment:
PGHOST: postgres
PGDATABASE: humanly_dev
PGUSER: humanly_user
PGPASSWORD: humanly_password
MIGRATIONS_DIR: /migrations
volumes:
- ./packages/backend/src/db/migrations:/migrations:ro
- ./scripts/quickstart-migrate.sh:/quickstart-migrate.sh:ro
depends_on:
postgres:
condition: service_healthy
command: ["sh", "/quickstart-migrate.sh"]
restart: "no"
quickstart-seed:
image: humanly-quickstart-backend:local
build:
context: .
dockerfile: docker/backend.Dockerfile
environment:
HUMANLY_QUICKSTART: "true"
NODE_ENV: development
PORT: 3001
DATABASE_URL: postgresql://humanly_user:humanly_password@postgres:5432/humanly_dev
DATABASE_POOL_MIN: 1
DATABASE_POOL_MAX: 5
DATABASE_SSL: "false"
REDIS_URL: redis://redis:6379
JWT_SECRET: humanly_quickstart_local_jwt_secret_change_before_production
JWT_ACCESS_EXPIRES: 15m
JWT_REFRESH_EXPIRES: 7d
CORS_ORIGIN: http://localhost:3000,http://localhost:3002,http://127.0.0.1:3000,http://127.0.0.1:3002
FRONTEND_ADMIN_URL: http://localhost:3000
FRONTEND_USER_URL: http://localhost:3002
PUBLIC_API_URL: http://localhost:3001/api/v1
EMAIL_SERVICE: console
EMAIL_FROM: noreply@humanly.local
RATE_LIMIT_ENABLED: "true"
FILE_STORAGE_PROVIDER: local
UPLOAD_DIR: /app/storage
AI_AGENT_MAX_TOOL_CALLS: 60
AI_PROVIDER_TIMEOUT_MS: 180000
AI_ENCRYPTION_KEY: "0000000000000000000000000000000000000000000000000000000000000000"
LOG_LEVEL: info
QUICKSTART_ADMIN_EMAIL: admin@mail.com
QUICKSTART_ADMIN_PASSWORD: admin123456
depends_on:
quickstart-migrate:
condition: service_completed_successfully
command: ["node", "dist/jobs/seed-quickstart-admin.js"]
restart: "no"
backend:
image: humanly-quickstart-backend:local
build:
context: .
dockerfile: docker/backend.Dockerfile
environment:
HUMANLY_QUICKSTART: "true"
NODE_ENV: development
PORT: 3001
DATABASE_URL: postgresql://humanly_user:humanly_password@postgres:5432/humanly_dev
DATABASE_POOL_MIN: 1
DATABASE_POOL_MAX: 10
DATABASE_SSL: "false"
REDIS_URL: redis://redis:6379
JWT_SECRET: humanly_quickstart_local_jwt_secret_change_before_production
JWT_ACCESS_EXPIRES: 15m
JWT_REFRESH_EXPIRES: 7d
CORS_ORIGIN: http://localhost:3000,http://localhost:3002,http://127.0.0.1:3000,http://127.0.0.1:3002
FRONTEND_ADMIN_URL: http://localhost:3000
FRONTEND_USER_URL: http://localhost:3002
PUBLIC_API_URL: http://localhost:3001/api/v1
EMAIL_SERVICE: console
EMAIL_FROM: noreply@humanly.local
RATE_LIMIT_ENABLED: "true"
FILE_STORAGE_PROVIDER: local
UPLOAD_DIR: /app/storage
AI_AGENT_MAX_TOOL_CALLS: 60
AI_PROVIDER_TIMEOUT_MS: 180000
AI_ENCRYPTION_KEY: "0000000000000000000000000000000000000000000000000000000000000000"
LOG_LEVEL: info
INFERENCE_URL: http://inference:8000
ports:
- "127.0.0.1:3001:3001"
volumes:
- quickstart_uploads:/app/storage
depends_on:
redis:
condition: service_healthy
quickstart-seed:
condition: service_completed_successfully
healthcheck:
test: ["CMD-SHELL", "node -e \"require('http').get('http://127.0.0.1:3001/health',(r)=>process.exit(r.statusCode===200?0:1)).on('error',()=>process.exit(1))\""]
interval: 10s
timeout: 5s
retries: 12
start_period: 20s
restart: unless-stopped
inference:
# Unified multi-model inference service (Python/FastAPI). detector is the first model, served at /models/detector.
# The image contains code only. Local quickstart can run without private detector weights;
# detector requests return an inconclusive result until model.joblib is mounted.
image: humanly-inference:local
build:
context: ./packages/inference
dockerfile: Dockerfile
# Weights are excluded from the image (see .dockerignore); mount the local
# gitignored weights dir read-only when model.joblib is available.
environment:
MODEL_PATH: /models/detector/model.joblib
INFERENCE_ALLOW_MISSING_MODELS: "true"
MIN_KEYDOWN: "50" # detector quality gate: min keystrokes to judge (runtime policy, not in the model)
DETECTOR_THRESHOLD: "0.85" # agent verdict cutoff; overrides the threshold stored in the model
volumes:
- ./packages/inference/models:/models:ro
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/health').status==200 else 1)\""]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
restart: unless-stopped
frontend:
build:
context: .
dockerfile: docker/frontend.Dockerfile
args:
NEXT_PUBLIC_API_URL: http://localhost:3001
NEXT_PUBLIC_WS_URL: http://localhost:3001
NEXT_PUBLIC_TRACKER_URL: http://localhost:3001/tracker/humanly-tracker.min.js
NEXT_PUBLIC_BASE_PATH: ""
environment:
NODE_ENV: production
PORT: 3000
HOSTNAME: 0.0.0.0
ports:
- "127.0.0.1:3000:3000"
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
frontend-user:
build:
context: .
dockerfile: docker/frontend-user.Dockerfile
args:
NEXT_PUBLIC_API_URL: http://localhost:3001/api/v1
NEXT_PUBLIC_WS_URL: http://localhost:3001
environment:
NODE_ENV: production
PORT: 3002
HOSTNAME: 0.0.0.0
ports:
- "127.0.0.1:3002:3002"
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
volumes:
quickstart_postgres_data:
quickstart_redis_data:
quickstart_uploads: