-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-start.sh
More file actions
executable file
·35 lines (27 loc) · 837 Bytes
/
docker-start.sh
File metadata and controls
executable file
·35 lines (27 loc) · 837 Bytes
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
#!/bin/bash
# Startup script for Docker container
# Runs both Rust backend and lighttpd frontend
echo "Starting WLED Server in Docker..."
# Start backend in background
echo "Starting Rust backend on port 3010..."
/app/backend &
BACKEND_PID=$!
# Start frontend in background (lighttpd serving static files with SPA support)
echo "Starting lighttpd frontend on port 3011..."
lighttpd -D -f /etc/lighttpd/lighttpd.conf &
FRONTEND_PID=$!
# Function to handle shutdown
shutdown() {
echo "Shutting down services..."
kill $BACKEND_PID $FRONTEND_PID
wait $BACKEND_PID $FRONTEND_PID
exit 0
}
# Trap termination signals
trap shutdown SIGTERM SIGINT
echo "Both services started:"
echo " Backend PID: $BACKEND_PID"
echo " Frontend PID: $FRONTEND_PID"
echo "Ready!"
# Wait for both processes
wait $BACKEND_PID $FRONTEND_PID