Skip to content

Instantly share code, notes, and snippets.

@pstaender
Last active September 24, 2018 13:10
Show Gist options
  • Save pstaender/a2cf782617e5175f2c5bc486e897c950 to your computer and use it in GitHub Desktop.
Save pstaender/a2cf782617e5175f2c5bc486e897c950 to your computer and use it in GitHub Desktop.
Quick sentry for docker-compose
# 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
image: sentry:9.0-onbuild
depends_on:
- redis
- postgres
- memcached
- smtp
environment:
# Run `docker-compose run web config generate-secret-key`
# to get the SENTRY_SECRET_KEY value.
SENTRY_SECRET_KEY: '+9id0734)7r0)6#c-lc7@v&vd7^=vx&b9uh=n=#l40b5t3r&3d'
SENTRY_MEMCACHED_HOST: memcached
SENTRY_REDIS_HOST: redis
SENTRY_POSTGRES_HOST: postgres
SENTRY_EMAIL_HOST: smtp
volumes:
- ./data/sentry:/var/lib/sentry/files
services:
smtp:
restart: unless-stopped
image: tianon/exim4
memcached:
restart: unless-stopped
image: memcached:1.4
redis:
restart: unless-stopped
image: redis:3.2-alpine
postgres:
restart: unless-stopped
image: postgres:9.5
volumes:
- ./data/postgres:/var/lib/postgresql/data
web:
<<: *defaults
ports:
- '9000:9000'
cron:
<<: *defaults
command: run cron
worker:
<<: *defaults
command: run worker

HowTo Sentry with Docker

  • Create a folder for your sentry service
  • Create a docker-compose.yml-file inside and use the file below as template

Then execute in your shell:

$ docker-compose build

$ docker-compose run --rm web config generate-secret-key

# insert the given key in you `docker-compose.yml` in line 23

$ docker-compose run --rm web upgrade

Create in the last step an admin user with a password (choose an email as username) and you're done.

Finally start your sentry service with:

  $ docker-compose up -d

and sentry should be available on http://localhost:9000.

For further details and more detailed step-by-step-guide have a look at https://github.com/getsentry/onpremise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment