Sentry On-Premise

Official bootstrap for running your own Sentry with Docker.

Requirements

  • Docker 1.10.0+
  • Compose 1.6.0+ (optional)

Up and Running

Assuming you've just cloned this repository, the following steps will get you up and running in no time!

There may need to be modifications to the included docker-compose.yml file to accommodate your needs or your environment. These instructions are a guideline for what you should generally do.

  1. docker volume create --name=sentry-data && docker volume create --name=sentry-postgres - Make our local database and sentry volumes Docker volumes have to be created manually, as they are declared as external to be more durable.
  2. cp -n .env.example .env - create env config file
  3. docker-compose build - Build and tag the Docker services
  4. docker-compose run --rm web config generate-secret-key - Generate a secret key. Add it to .env as SENTRY_SECRET_KEY.
  5. docker-compose run --rm web upgrade - Build the database. Use the interactive prompts to create a user account.
  6. docker-compose up -d - Lift all services (detached/background mode).
  7. Access your instance at localhost:9000!

Securing Sentry with SSL/TLS

If you'd like to protect your Sentry install with SSL/TLS, there are fantastic SSL/TLS proxies like HAProxy and Nginx.

Updating Sentry

Updating Sentry using Compose is relatively simple. Just use the following steps to update. Make sure that you have the latest version set in your Dockerfile. Or use the latest version of this repository.

Use the following steps after updating this repository or your Dockerfile:

docker-compose build # Build the services again after updating
docker-compose run --rm web upgrade # Run new migrations
docker-compose up -d # Recreate the services

Running sentry cleanup

To free up DB space etc, run sentry cleanup --days 90 --concurrency 25. Steps to do so:

  • Build docker containers locally by running docker-compose build
  • make sure the correct AWS envs vars are set (e.g., run ./htprod to set aws keys)
  • run docker run -it --entrypoint bash sentry-onpremise_cron
  • copy the env vars from ECS tasks and convert them into export foo=bar strings
  • run sentry cleanup --days 90 and make sure you have access to reources in the vpc (e.g., run sshuttle -r vpn-prod 172.23.0.0/16 -v)
  • concurrency needs to be set or cleanup will take a very long time

Resources