env: add start.sh
this script easily lets you start the compose file and backend in 1 sh script and stops it once it recieves a ctrl+c
This commit is contained in:
parent
c0afe8b56e
commit
c52f0fed60
1 changed files with 23 additions and 0 deletions
23
start.sh
Executable file
23
start.sh
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
terminate_script() {
|
||||
echo "Stopping the script and killing background processes..."
|
||||
|
||||
docker compose down
|
||||
|
||||
# Kill all child processes (background processes)
|
||||
pkill -P $$ # $$ refers to the PID of the script itself
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
trap 'terminate_script' INT TERM HUP
|
||||
|
||||
# Start the first process
|
||||
$(docker compose up -d)
|
||||
|
||||
|
||||
# Start the second process
|
||||
$(cargo dev)
|
||||
|
||||
|
Loading…
Reference in a new issue