Skip to content

Instantly share code, notes, and snippets.

@centum
Created April 9, 2019 14:48
Show Gist options
  • Save centum/e3d1e56c56730347b908c94fa4aa0fdb to your computer and use it in GitHub Desktop.
Save centum/e3d1e56c56730347b908c94fa4aa0fdb to your computer and use it in GitHub Desktop.
Start sentry by docker image
#!/bin/bash
set -e
IMG=${SENTRY_IMAGE:-'sentry:9.0'}
if [ "${1:0:1}" = '-' ] || [ "$1" = "" ]; then
CMD="uwsgi"
ARGS=$@
else
CMD=$1
shift
ARGS=$@
fi
set -- docker run --hostname dev-sentry-$CMD --name dev-sentry-$CMD --network bb_net --env-file .env -v sentry_files:/var/lib/sentry/files -v sentry_conf:/etc/sentry
case "$CMD" in
uwsgi)
set -- "$@" --restart always -p 127.0.0.1:9000:9000 -d $IMG $ARGS
;;
worker|cron)
set -- "$@" --restart always -d $IMG run $CMD $ARGS
;;
*)
# upgrade, createuser
set -- "$@" -it --rm $IMG $CMD $ARGS
;;
esac
exec "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment