Skip to content

Instantly share code, notes, and snippets.

Last active December 21, 2015 04:39
What would you like to do?
A wrapper script that will start a local SSH tunnel (only in development environment), and then start Puma as normal. I use this with foreman from a Procfile.
#!/usr/bin/env sh
# For the payment gateway callback URL
if [ "$CURRENT_ENV" == "development" ]; then
PORT_SSL=$(expr $PORT + 1)
echo "starting an SSL tunnel from :$PORT_SSL --(--)--> :$PORT"
bundle exec tunnels $PORT_SSL$PORT &
bundle exec puma -b tcp://$PORT -t 0:${WEB_CONCURRENCY:-16} -e $CURRENT_ENV
# from a Procfile (bundler) you'd use this as
# web: bin/puma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment