Skip to content

Instantly share code, notes, and snippets.

@dpaluy
Created September 6, 2024 20:42
Show Gist options
  • Save dpaluy/3d144eee98baecc56e8b3409b36836cb to your computer and use it in GitHub Desktop.
Save dpaluy/3d144eee98baecc56e8b3409b36836cb to your computer and use it in GitHub Desktop.
bin/dev with Overmind example
#!/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