Skip to content

Commit

Permalink
Sentry On-Premise docker-compose for local development
Browse files Browse the repository at this point in the history
  • Loading branch information
bottleneko committed Jun 27, 2019
1 parent b38ea26 commit 6d773f9
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SENTRY_SECRET_KEY=z7pq%@lw6ip_ef0+%=m=jr9w5&-q8k0gdds1@!sbb(3(^j6gclSENTRY_SECRET_KEY=z7pq%@lw6ip_ef0+%=m=jr9w5&-q8k0gdds1@!sbb(3(^j6gcl
SENTRY_SECRET_KEY=z7pq%@lw6ip_ef0+%=m=jr9w5&-q8k0gdds1@!sbb(3(^j6gcl
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM sentry:9.1-onbuild
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
install-sentry:
docker volume create --name=sentry-data
docker volume create --name=sentry-postgres
test -f .env && touch .env
docker-compose build
echo "SENTRY_SECRET_KEY=z7pq%@lw6ip_ef0+%=m=jr9w5&-q8k0gdds1@!sbb(3(^j6gcl" >> .env
docker-compose run --rm web upgrade
docker-compose up -d

remove-sentry:
docker-compose down
docker volume rm sentry-data
docker volume rm sentry-postgres
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ eraven

Erlang client for Sentry.

Development
-----

Installation

$ make install-sentry

Clean-up

$ make remove-sentry

Build
-----

Expand Down
64 changes: 64 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# While a lot of configuration in Sentry can be changed via the UI, for all
# new-style config (as of 8.0) you can also declare values here in this file
# to enforce defaults or to ensure they cannot be changed via the UI. For more
# information see the Sentry documentation.

###############
# Mail Server #
###############

# mail.backend: 'smtp' # Use dummy if you want to disable email entirely
# mail.host: 'localhost'
# mail.port: 25
# mail.username: ''
# mail.password: ''
# mail.use-tls: false
# The email address to send on behalf of
# mail.from: 'root@localhost'

# If you'd like to configure email replies, enable this.
# mail.enable-replies: false

# When email-replies are enabled, this value is used in the Reply-To header
# mail.reply-hostname: ''

# If you're using mailgun for inbound mail, set your API key and configure a
# route to forward to /api/hooks/mailgun/inbound/
# mail.mailgun-api-key: ''

###################
# System Settings #
###################

# If this file ever becomes compromised, it's important to regenerate your a new key
# Changing this value will result in all current sessions being invalidated.
# A new key can be generated with `$ sentry config generate-secret-key`
system.secret-key: 'z7pq%@lw6ip_ef0+%=m=jr9w5&-q8k0gdds1@!sbb(3(^j6gcl'
system.url-prefix: 'http://localhost:9000'

# The ``redis.clusters`` setting is used, unsurprisingly, to configure Redis
# clusters. These clusters can be then referred to by name when configuring
# backends such as the cache, digests, or TSDB backend.
# redis.clusters:
# default:
# hosts:
# 0:
# host: 127.0.0.1
# port: 6379

################
# File storage #
################

# Uploaded media uses these `filestore` settings. The available
# backends are either `filesystem` or `s3`.

# filestore.backend: 'filesystem'
# filestore.options:
# location: '/tmp/sentry-files'

# filestore.backend: 's3'
# filestore.options:
# access_key: 'AKIXXXXXX'
# secret_key: 'XXXXXXX'
# bucket_name: 's3-bucket-name'
59 changes: 59 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# NOTE: This docker-compose.yml is meant to be just an example of how
# you could accomplish this on your own. It is not intended to work in
# all use-cases and must be adapted to fit your needs. This is merely
# a guideline.

# See docs.getsentry.com/on-premise/server/ for full
# instructions

version: '3.4'

x-defaults: &defaults
restart: unless-stopped
build: .
depends_on:
- redis
- postgres
- memcached
env_file: .env
environment:
SENTRY_MEMCACHED_HOST: memcached
SENTRY_REDIS_HOST: redis
SENTRY_POSTGRES_HOST: postgres
volumes:
- sentry-data:/var/lib/sentry/files


services:
memcached:
restart: unless-stopped
image: memcached:1.5-alpine

redis:
restart: unless-stopped
image: redis:3.2-alpine

postgres:
restart: unless-stopped
image: postgres:9.5
volumes:
- sentry-postgres:/var/lib/postgresql/data

web:
<<: *defaults
ports:
- '9000:9000'

cron:
<<: *defaults
command: run cron

worker:
<<: *defaults
command: run worker

volumes:
sentry-data:
external: true
sentry-postgres:
external: true

0 comments on commit 6d773f9

Please sign in to comment.