ffedoroff / docker-sentry

Docker-Compose Image packaging for Sentry

Home Page:https://getsentry.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sentry + docker-compose + postgre to s3 backup

What is inside

  1. Official sentry container This container based on the official Docker image for sentry.

  2. Customizable configuration file. It is extended with customizable configuration file custom.conf.py where you able to add any of your sentry parameters, such as SENTRY_URL_PREFIX, SERVER_EMAIL etc. This config file extends default sentry config.

  3. Database backup tool. This is postgre database backup and restore tool. This tool allows to setup schedduled cron task to backup database and automatically upload it to S3 bucket.

  4. docker-compose. Everything works from the box. You don't need to setup anything. Just enter few parameters in 2 files and you will have Sentry + Postgres + Redis + Celery beat + Celery worker + Backups setup automatically.

How to use:

0. Prerequisites

You need to setup Docker and docker-copose to be able to run this container.

1. Clone repository

git clone https://github.com/ffedoroff/docker-sentry.git && cd docker-sentry

2. Update configs

You need to update few config files, to make sentry works for your domain and email.

Add any of sentry plugins, updating Dockerfile (see rows 7 and 8 here)

Set all parameters in custom.conf.py file. You can add any other sentry parameters in that file if you need it.

3. Enable backups (optional)

To make automated backups works (more info), uncomment pgbackup section in docker-compose.yml file and set parameters:

SCHEDULE - is like linux cron syntax, but with seconds precise. (Second, Minute, Hour, Day_of_the_Month, Month_of_the_Year, Day_of_the_Week)

AWS_S3_PATH - path to your amazon S3 bucket, for example: my-amazon-bucket/

AWS_KEY - your Amazon API key

AWS_SECERT - your Amazon API Secret

4. Run all containers

docker-compose build
docker-compose up -d

Now Sentry will work on your server and start automatically when server starts. To open sentry just open url of your server (it should match SENTRY_URL_PREFIX parameter in custom.conf.py file)

To stop containsers call:

docker-compose stop

5. Database setup

If this is your fist run, you should syncdb and process db migrations, just run sentry syncdb and sentry migrate in sentry container like this:

docker exec -it dockersentry_sentry_1 sentry syncdb
docker exec -it dockersentry_sentry_1 sentry migrate

Backup database manually

To backup database run ./backup-upload.sh file in container:

docker exec -it dockersentry_pgbackup_1 ./backup-upload.sh

You will have proper database backup processed, archived and uploaded to S3 storage.

Restore database

You need to find url of your database archive in S3 storage and make it temporary public (if need). Assume, that your url is https://s3-us-west-1.amazonaws.com/your-bucket/sentry-20151110-021500.sql.gz To restore database run ./restore.sh file in container:

docker exec -it dockersentry_pgbackup_1 ./restore.sh https://s3-us-west-1.amazonaws.com/your-bucket/sentry-20151110-021500.sql.gz

About

Docker-Compose Image packaging for Sentry

https://getsentry.com


Languages

Language:Python 100.0%