Skip to content

Production ready Sentry configuration for Docker Compose

License

Notifications You must be signed in to change notification settings

jquacinella/sentry

 
 

Repository files navigation

Sentry on Docker Compose

This is a production ready setup of Sentry with Postgres and Redis using Docker Compose. Originally created by Turistforeningen, updated to be more flexible and updated for newest version of Sentry.

Docker Compose container overview

What are the requirements?

Configuration

The sentry.conf.py and config.yml holds all the Sentry configurations. Your secret stuff, however, has to be put into an environment file called environment.sh in a secrets/ folder (which is ignored by .gitignore). Mainly, you need

  • SECRET_KEY

for sentry. Fill in email config knobs in config.yml, and update SENTRY_URL_PREFIX in sentry.conf.py.

Building

The compose file relies on an image named sentry_image, and to build it, run:

sudo docker build --rm=true -t sentry_image ./

Installation

First, lets bring up the stack via compose:

cp docker-compose.template.yml docker-compose.custom.yml
vi docker-compose.custom.yml
# Chnage network name and details, as well as the host directories for volumes
docker-compose -f docker-compose.yml -f docker-compose.custom.yml up -d

After that, run SQL migrations to get the database up and running. This will also ask you to create a user; at this point, create one user that has admin privileges.

docker-compose -f docker-compose.yml -f docker-compose.custom.yml run sentry upgrade

If you later want to add more users or didn't did it the first time around, run:

docker-compose -f docker-compose.yml -f docker-compose.custom.yml run www createuser

Errata

The requirements.txt file in the repo determines which version of sentry and supporting packages are installed during the build of the image. If you need to upgrade or downgrade sentry, update the file as needed. As of this commit, sentry is installed at version 8.3.3.

Troubleshooting

To see logs, you can run:

sudo docker-compose logs -f sentry
sudo docker-compose logs -f sentry_celery_beat
sudo docker-compose logs -f sentry_celery_worker
...

to see the logs of the varous sentry components.

TODO

  • Dockerize the www container to wait for postgres db to be up and running
  • Deal with C_FORCE_ROOT=true, which is warned against

About

Production ready Sentry configuration for Docker Compose

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%