forked from coollabsio/coolify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed extra container and added new process to soketi container
- Loading branch information
1 parent
548fc21
commit 2b8c992
Showing
6 changed files
with
70 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
# Install openssh-client | ||
apk add --no-cache openssh-client make g++ python3 | ||
|
||
cd /terminal | ||
|
||
# Install npm dependencies | ||
npm ci | ||
|
||
# Rebuild node-pty | ||
npm rebuild node-pty --update-binary | ||
|
||
# Function to timestamp logs | ||
timestamp() { | ||
date "+%Y-%m-%d %H:%M:%S" | ||
} | ||
|
||
# Start the terminal server in the background with logging | ||
node --watch /terminal/terminal-server.js > >(while read line; do echo "$(timestamp) [TERMINAL] $line"; done) 2>&1 & | ||
TERMINAL_PID=$! | ||
|
||
# Start the Soketi process in the background with logging | ||
node /app/bin/server.js start > >(while read line; do echo "$(timestamp) [SOKETI] $line"; done) 2>&1 & | ||
SOKETI_PID=$! | ||
|
||
# Function to forward signals to child processes | ||
forward_signal() { | ||
kill -$1 $TERMINAL_PID $SOKETI_PID | ||
} | ||
|
||
# Forward SIGTERM to child processes | ||
trap 'forward_signal TERM' TERM | ||
|
||
# Wait for any process to exit | ||
wait -n | ||
|
||
# Exit with status of process that exited first | ||
exit $? |