Skip to content

Commit

Permalink
fix(backend): Fix docker CTRL+C
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed Dec 15, 2024
1 parent a4efecb commit 3a7245f
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions backend/docker.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
#!/bin/ash

# This is the Dockerfile's entrypoint script.

# https://docs.docker.com/config/containers/multi-service_container/

# Function to terminate processes
cleanup() {
echo "Shutting down..."
kill $(jobs -p)
exit 0
}

# Set up signal handling
trap cleanup SIGTERM SIGINT

# Start chromedriver in background
chromedriver &
./reacher_backend

# Start reacher backend in background
./reacher_backend &

# Wait for any process to exit
wait -n

# Exit with status of process that exited first
exit $?

0 comments on commit 3a7245f

Please sign in to comment.