2
0
Clean and backupable on-premise deployment of Sentry using Docker COmpose
This repository has been archived on 2020-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
2016-10-13 22:48:17 -04:00
.dockerignore mv docker-compose.yml{.example,} 2016-05-27 17:01:34 -07:00
.gitignore Mount the required volume 2016-05-27 16:45:18 -07:00
config.yml Update with 8.4 2016-05-26 16:07:32 -07:00
docker-compose.yml Compartmentalize data folder 2016-08-04 17:50:24 +03:00
Dockerfile Upgrade to use sentry 8.9 2016-10-12 19:21:55 +05:30
Makefile Default make all to build and push 2016-06-03 14:54:36 -07:00
README.md enhance readme 2016-10-13 22:48:17 -04:00
requirements.txt Getting started 2016-02-11 13:52:19 -08:00
sentry.conf.py Update with 8.4 2016-05-26 16:07:32 -07:00

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!

  1. mkdir -p data/{sentry,postgres} - Make our local database and sentry config directories. This directory is bind-mounted with postgres so you don't lose state!
  2. docker-compose run web config generate-secret-key - Generate a secret key. Add it to docker-compose.yml in base as SENTRY_SECRET_KEY.
  3. docker-compose run web upgrade - Build the database. Use the interactive prompts to create a user account.
  4. docker-compose up -d - Lift all services (detached/background mode).
  5. Access your instance at localhost:9000!

Note that as long as you have your database bind-mounted, you should be fine stopping and removing the containers without worry.

Backing up postgres

Following with the trend of containers, you could even add something like this to backup postgres to an AWS S3 bucket:

  postgresqlbackup:
    image: inanimate/postgres-s3-archive:9.5
    restart: always
    links:
        - postgres:postgres 
    environment:
        - "AWS_ACCESS_KEY_ID=PUTACCESSIDHERE"
        - "AWS_SECRET_ACCESS_KEY=PUTSECRETKEYHERE"
        - "BUCKET=s3://awesomebackupsbucket/sentry"
        - "SYMMETRIC_PASSPHRASE=hahacanthaxme"
        - "NAME_PREFIX=sentry-database-backup"
        - "PGHOST=postgres"
        - "PGPORT=5432"

This container runs pgdump to take snapshots of your database on a certain time frame. You could also use other backup facilities on the host which you're running the containers.

Reverse Proxying (SSL/TLS)

The absolute easiest way to get SSL/TLS protecting your Sentry server is to use Caddy. Caddy will handle automatic SSL certificate obtainment and renewal from Let's Encrypt for you.

Here is an example Caddyfile configuration:

sentry.example.net {
    proxy / web:9000 {
        transparent
    }
    tls {
        max_certs 1
    }
}

The above would work with a caddy entry in docker-compose.yml like:

caddy:
    image: abiosoft/caddy:0.9.3
    restart: always
    volumes:
        - ./Caddyfile:/etc/Caddyfile
        - ./caddydata:/root/.caddy
    ports:
        - "80:80"
        - "443:443"
    links:
        - web

Resources