forked from CasualOffice/sheets
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
56 lines (55 loc) · 2.46 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
56 lines (55 loc) · 2.46 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
# Casual Sheets — development override.
#
# docker compose -f docker-compose.yml -f docker-compose.dev.yml up
#
# Skips the prebuilt app image and runs the live Vite dev server + tsx
# watcher with the workspace bind-mounted, so hot reload works inside the
# container. Redis still comes from the same service in docker-compose.yml.
#
# For most local work, `pnpm dev:web` + `pnpm dev:server` on the host is
# faster — this file is for parity-testing the Docker network setup
# (Redis URL, WebSocket upgrade through the same container, etc.).
services:
app:
# Override the runtime image with a Node-only base; we run pnpm dev
# against the bind-mount instead of executing a built artifact.
image: node:22-alpine
# Runs as root inside the container — fine for local dev. The
# alternative (running as `node` uid 1000) was that `corepack
# enable` couldn't symlink into root-owned /usr/local/bin, and the
# anonymous node_modules volumes (which docker creates as root)
# weren't writable by uid 1000 either. The bind-mounted source
# tree is only WRITTEN by pnpm install when the lockfile drifts;
# we use `--frozen-lockfile` so that errors out instead of writing
# — meaning no root-owned files leak back to the host repo.
working_dir: /app
# pnpm via `npm i -g` instead of `corepack enable`: simpler, works
# the same as root either way, and avoids the corepack symlink
# permission dance entirely.
command:
- sh
- -lc
- |
npm install -g pnpm@10.33.4
pnpm install --frozen-lockfile
pnpm --filter @casualoffice/collab dev &
pnpm --filter @sheet/web dev --host 0.0.0.0 &
wait
volumes:
- .:/app
# Anonymous volumes hide the host's host-arch node_modules from the
# alpine container — Linux-built native modules (esbuild) would
# collide with whatever the host has.
- /app/node_modules
- /app/apps/web/node_modules
- /app/apps/server/node_modules
ports:
- '3000:3000' # server + Hocuspocus
- '5273:5273' # Vite dev server
environment:
# Vite serves on 5273; tell the bridge to point at the server on 3000.
VITE_COLLAB_WS_URL: ws://localhost:3000/yjs
# Flips the `isCollabEnabled()` gate in CollabDriver — without it the
# frontend renders the "Co-editing requires self-hosting" banner even
# though the server IS running locally. Required for Share / Join.
VITE_COLLAB_ENABLED: '1'