Created
September 6, 2024 20:42
-
-
Save dpaluy/3d144eee98baecc56e8b3409b36836cb to your computer and use it in GitHub Desktop.
bin/dev with Overmind example
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
#!/bin/bash | |
if ! gem list overmind -i --silent; then | |
echo "Installing overmind..." | |
gem install overmind | |
fi | |
# Default to port 3000 if not specified | |
export PORT="${PORT:-3000}" | |
function cleanup { | |
echo "Shutting down overmind..." | |
kill $(cat tmp/pids/overmind.pid) &> /dev/null; | |
overmind kill; | |
} | |
trap cleanup EXIT | |
# start overmind detached | |
overmind start --ignored-processes web -f Procfile.dev <&0 & | |
echo $! > tmp/pids/overmind.pid | |
bin/rails server "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment