-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
78 lines (72 loc) · 2.69 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
78 lines (72 loc) · 2.69 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
# Development stack. Run it standalone:
#
# docker compose -f docker-compose.dev.yml up
#
# Same backend as production (api / worker / redis / chroma are pulled from
# docker-compose.yml via `extends`, so they never drift), but the frontend is a
# Vite dev server with hot-reload instead of the nginx static build — edit
# anything under ./ui and the browser updates live, no rebuild.
#
# Production stays `docker compose up` (docker-compose.yml, nginx static build).
networks:
embedbase_net:
driver: bridge
volumes:
embedbase_data:
redis_data:
console_node_modules:
services:
# `extends` copies each service's config but NOT depends_on, so it's re-declared.
api:
extends:
file: docker-compose.yml
service: api
depends_on:
redis:
condition: service_healthy
chroma:
condition: service_healthy
worker:
extends:
file: docker-compose.yml
service: worker
depends_on:
redis:
condition: service_healthy
redis:
extends:
file: docker-compose.yml
service: redis
chroma:
extends:
file: docker-compose.yml
service: chroma
# Frontend: Vite dev server with hot-reload. Source is bind-mounted; edits are
# reflected live. Proxies /api and /mcp to the api service (ui/vite.config.ts,
# VITE_API_PROXY). First boot runs `npm install` into a named volume (~30-60s).
console:
image: node:20-alpine
working_dir: /app
# The node_modules volume can get seeded with the host's (possibly Windows)
# node_modules via the ./ui bind mount, which breaks `npm install` with cross-
# platform leftovers. So on first boot, clear the volume's contents and do a
# clean install, marked done so later starts go straight to the dev server.
# ponytail: install runs once; `docker volume rm embedbase_console_node_modules`
# forces a clean reinstall if deps change.
command: sh -c "[ -f node_modules/.dev-ready ] || { find node_modules -mindepth 1 -delete 2>/dev/null; npm install --no-audit --no-fund && touch node_modules/.dev-ready; }; exec npm run dev -- --host 0.0.0.0"
environment:
- VITE_API_PROXY=http://api:8000
# Bind-mounted source from a Windows/macOS host emits no inotify events the
# Linux container can see, so make Vite's watcher poll (see ui/vite.config.ts);
# otherwise hot-reload silently never fires.
- VITE_USE_POLLING=true
volumes:
- ./ui:/app
# Named volume so the container's Linux node_modules isn't shadowed by the
# host's (a host install may be a different OS/arch).
- console_node_modules:/app/node_modules
ports:
- "${UI_PORT:-3000}:3000"
depends_on:
- api
networks: [embedbase_net]