Fix y-websocket sidecar: use v1 with setupWSConnection
y-websocket v2 removed the server binary. Use v1 which includes bin/utils.js with setupWSConnection for the WS relay server. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b9bf2c8b70
commit
f35ed40a63
|
|
@ -52,7 +52,22 @@ services:
|
|||
container_name: rnotes-yws
|
||||
restart: unless-stopped
|
||||
working_dir: /app
|
||||
command: ["sh", "-c", "npm install y-websocket && node node_modules/y-websocket/bin/server.cjs"]
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
npm init -y > /dev/null 2>&1
|
||||
npm install y-websocket@1 ws > /dev/null 2>&1
|
||||
node -e "
|
||||
const ws = require('ws');
|
||||
const Y = require('yjs');
|
||||
const {setupWSConnection, docs} = require('y-websocket/bin/utils');
|
||||
const host = process.env.HOST || '0.0.0.0';
|
||||
const port = parseInt(process.env.PORT || '1234');
|
||||
const wss = new ws.Server({ host, port });
|
||||
wss.on('connection', setupWSConnection);
|
||||
console.log('y-websocket server running on ' + host + ':' + port);
|
||||
"
|
||||
environment:
|
||||
- HOST=0.0.0.0
|
||||
- PORT=1234
|
||||
|
|
|
|||
Loading…
Reference in New Issue