Skip to content

Instantly share code, notes, and snippets.

@joshlarsen
Created October 13, 2021 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshlarsen/7c4aa8a462dcc91b0a41c89e6af09623 to your computer and use it in GitHub Desktop.
Save joshlarsen/7c4aa8a462dcc91b0a41c89e6af09623 to your computer and use it in GitHub Desktop.
Rails binstubs
#!/bin/bash
#
# Make sure to stop/start the Redis Docker container properly.
#
CONTAINER_NAME="redis-container"
DOCKER_START="docker start -ai ${CONTAINER_NAME}"
DOCKER_RUN="docker run --name ${CONTAINER_NAME} -p 6379:6379 redis"
# is there an existing container named 'redis'?
if $(docker ps -a|grep ${CONTAINER_NAME} > /dev/null) ; then
$DOCKER_START
else
$DOCKER_RUN
fi
#!/bin/bash
# start sidekiq
bundle exec sidekiq -q default -q mailers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment