feat: implement custom Next.js server with integrated WebSocket (POC)
- Create apps/nextjs/server.ts custom server integrating WebSocket via ws - Update nextjs scripts to use custom server for dev and start - Update root start script to remove separate ws server process - Update client tRPC URL to connect to port 3000 in dev - Update nginx.conf to route /websockets to port 3000 - Update Dockerfile and run.sh for integrated server - Disable standalone ws server dev script - Add benchmark-memory.sh script Co-authored-by: ajnart <49837342+ajnart@users.noreply.github.com>
This commit is contained in:
1 parent
000604bd02
commit
c8ae7f283a
11 files changed
+248
-31
No files matched your search
+3
-5
@@ -48,16 +48,14 @@ fi
|
||||
node apps/tasks/tasks.cjs &
|
||||
TASKS_PID=$!
|
||||
|
||||
node apps/websocket/wssServer.cjs &
|
||||
WSS_PID=$!
|
||||
|
||||
node apps/nextjs/server.js &
|
||||
# WebSocket server is now integrated into the custom Next.js server
|
||||
node apps/nextjs/customServer.cjs &
|
||||
NEXTJS_PID=$!
|
||||
|
||||
# Function to handle SIGTERM and shut down services
|
||||
terminate() {
|
||||
echo "Received SIGTERM. Shutting down..."
|
||||
kill -TERM $NGINX_PID $TASKS_PID $WSS_PID $NEXTJS_PID 2>/dev/null
|
||||
kill -TERM $NGINX_PID $TASKS_PID $NEXTJS_PID 2>/dev/null
|
||||
wait
|
||||
# kill redis-server last because of logging of other services and only if $REDIS_PID is set
|
||||
if [ -n "$REDIS_PID" ]; then
|
||||
|
||||
Reference in new issue
Block a user